Skip to content

Commit

Permalink
close connection if there's unread chunked data (thx cmlenz)
Browse files Browse the repository at this point in the history
git-svn-id: http://mochiweb.googlecode.com/svn/trunk@79 583d1f64-3c3e-0410-8459-0f15fcd77d59
  • Loading branch information
matthew.dempsky committed Jun 23, 2008
1 parent 5fedcc0 commit f356dd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mochiweb_request.erl
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ should_close() ->
%% unread data left on the socket, can't safely continue
orelse (DidNotRecv
andalso get_header_value("content-length") =/= undefined
andalso list_to_integer(get_header_value("content-length")) > 0).
andalso list_to_integer(get_header_value("content-length")) > 0)
orelse (DidNotRecv
andalso get_header_value("transfer-encoding") =:= "chunked").

%% @spec cleanup() -> ok
%% @doc Clean up any junk in the process dictionary, required before continuing
Expand Down

0 comments on commit f356dd4

Please sign in to comment.