Skip to content

Commit 5e47b28

Browse files
committed
A bit more cleanup for R15 emsgsize workaround
Since we're not inspecting the message in handle_invalid_msg_request any longer, we don't have to pass the message in altogether.
1 parent 22032de commit 5e47b28

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

src/mochiweb_http.erl

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ request(Socket, Opts, Body) ->
108108
request(Socket, Opts, Body);
109109
{tcp_closed = Error, _} ->
110110
mochiweb_socket:close(Socket), exit({shutdown, Error});
111-
{tcp_error, _, emsgsize} = Other ->
112-
handle_invalid_msg_request(Other, Socket, Opts);
111+
{tcp_error, _, emsgsize} ->
112+
handle_invalid_request(Socket, Opts);
113113
{ssl_closed = Error, _} ->
114114
mochiweb_socket:close(Socket), exit({shutdown, Error})
115115
after ?REQUEST_RECV_TIMEOUT ->
@@ -145,9 +145,8 @@ headers(Socket, Opts, Request, Headers, Body,
145145
[{Name, Value} | Headers], Body, 1 + HeaderCount);
146146
{tcp_closed = Error, _} ->
147147
mochiweb_socket:close(Socket), exit({shutdown, Error});
148-
{tcp_error, _, emsgsize} = Other ->
149-
handle_invalid_msg_request(Other, Socket, Opts, Request,
150-
Headers)
148+
{tcp_error, _, emsgsize} ->
149+
handle_invalid_request(Socket, Opts, Request, Headers)
151150
after ?HEADERS_RECV_TIMEOUT ->
152151
mochiweb_socket:close(Socket), exit({shutdown, headers_recv_timeout})
153152
end.
@@ -157,20 +156,11 @@ call_body({M, F, A}, Req) when is_atom(M) ->
157156
call_body({M, F}, Req) when is_atom(M) -> M:F(Req);
158157
call_body(Body, Req) -> Body(Req).
159158

160-
-spec handle_invalid_msg_request(term(), term(),
161-
term()) -> no_return().
162-
163-
handle_invalid_msg_request(Msg, Socket, Opts) ->
164-
handle_invalid_msg_request(Msg, Socket, Opts,
159+
-spec handle_invalid_request(term(), term()) -> no_return().
160+
handle_invalid_request(Socket, Opts) ->
161+
handle_invalid_request(Socket, Opts,
165162
{'GET', {abs_path, "/"}, {0, 9}}, []).
166163

167-
-spec handle_invalid_msg_request(term(), term(), term(),
168-
term(), term()) -> no_return().
169-
170-
handle_invalid_msg_request(_Msg, Socket, Opts, Request,
171-
RevHeaders) ->
172-
handle_invalid_request(Socket, Opts, Request,
173-
RevHeaders).
174164

175165
-spec handle_invalid_request(term(), term(), term(),
176166
term()) -> no_return().

0 commit comments

Comments
 (0)