tjbush / mochiweb

Automatically exported from code.google.com/p/mochiweb
Other
0 stars 0 forks source link

[PATCH] Max body length not respected #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The change made in r90 had a mistake that causes the MaxBody parameter of 
mochiweb_request:recv_body/1 not to be taken into account properly. Instead, it 
always passes ?
MAX_RECV_BODY to mochiweb_request:stream_body/4.

The fix is pretty simple:

Index: src/mochiweb_request.erl
===========================================================
========
--- src/mochiweb_request.erl    (revision 95)
+++ src/mochiweb_request.erl    (working copy)
@@ -182,7 +182,7 @@
             true -> 
                 {NewLength, [Bin | BinAcc]}
             end
-        end, {0, []}, ?MAX_RECV_BODY),
+        end, {0, []}, MaxBody),
     put(?SAVE_BODY, Body),
     Body.

Original issue reported on code.google.com by cmlenz on 24 Feb 2009 at 2:05

GoogleCodeExporter commented 8 years ago
r96

Original comment by bob.ippo...@gmail.com on 24 Feb 2009 at 4:04