[Mongrel] Want feedback on Mongrel patch for handling partial PUT requests

cremes.devlist at mac.com cremes.devlist at mac.com
Mon Jan 22 23:03:18 EST 2007

On Jan 23, 2007, at 12:09 AM, Zed A. Shaw wrote:

> On Mon, 22 Jan 2007 19:27:35 -0600
> cremes.devlist at mac.com wrote:
>> By default, Mongrel will delete the HTTP request body and short
>> circuit calling any handlers if a request is interrupted or
>> incomplete. Unfortunately, this breaks any attempt to correctly
>> handle a partial PUT. (BTW, PUT is *way* more efficient for uploads
>> compared to POST which requires a MIME parsing step.) So, about a
>> month ago I wrote up some patches to Mongrel 0.3.18 that allowed
>> Mongrel to properly handle partial PUT requests. I sent the patch &
>> tests to Zed for comment but never really heard back.
> I'll take a look this weekend, but you really should have tests to  
> go with this just to make sure I'm trying it the way you are trying  
> it.

Here are the patches against Mongrel 1.0 plus a test file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_upload.rb
Type: text/x-ruby-script
Size: 7680 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070122/d93f08dc/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: handlers.diff
Type: application/octet-stream
Size: 267 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070122/d93f08dc/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mongrel.diff
Type: application/octet-stream
Size: 2951 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070122/d93f08dc/attachment-0003.obj 
-------------- next part --------------

> Also, seeing how it can improve or change the upload progress  
> problem (the fact that it sucks) would be a good first step.

That problem was a bit out of scope for me so I don't think this  
helps much. The common assumption is that people are using POST for  
uploads which this patch doesn't address at all.

> Otherwise, I'll look and get back to you.  Sorry I didn't get in  
> touch with you earlier.  Just been busy.

No problem; we're all busy!


More information about the Mongrel-users mailing list