# Chunked transfer

**URL:** <https://www.ruby-forum.com/t/chunked-transfer/190326>\
**Category:** Mongrel\
**Created:** [June 17, 2010, 6:58pm UTC](https://www.ruby-forum.com/t/chunked-transfer/190326 "2010-06-17T18:58:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![malvadomx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@malvadomx](https://www.ruby-forum.com/u/malvadomx)\
**Post date:** [June 17, 2010, 6:58pm UTC](https://www.ruby-forum.com/t/chunked-transfer/190326/1 "2010-06-17T18:58:19Z")

</div>

Hi.

Does mongrel support ‘chunked’ transfer encoding ?

We are sending images from a J2ME app, but do not seem to be able to  
read  
the entire xml message that gets sent from the mobile device. The  
message is  
posted to our RoR app running on a mongrel server.

Regards,

Sergio

---

<div class="post-metadata">

**Author:** ![malvadomx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@malvadomx](https://www.ruby-forum.com/u/malvadomx)\
**Post date:** [June 17, 2010, 10:47pm UTC](https://www.ruby-forum.com/t/chunked-transfer/190326/2 "2010-06-17T22:47:51Z")

</div>

I believe mongrel can be used to send chunked responses. I did that  
with  
the mongrel-esi server, haven’t been keeping it updated but might still  
be  
able to refer to that source as a reference…

On Thu, Jun 17, 2010 at 12:50 PM, Sergio L.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![malvadomx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@malvadomx](https://www.ruby-forum.com/u/malvadomx)\
**Post date:** [June 17, 2010, 11:03pm UTC](https://www.ruby-forum.com/t/chunked-transfer/190326/3 "2010-06-17T23:03:39Z")

</div>

Hi. Thanks for replying.

Unfortunately we need to receive chunked requests sent to a mongrel  
server.  
Are there any other alternatives other than WEBrick ?

G.

---

<div class="post-metadata">

**Author:** ![malvadomx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@malvadomx](https://www.ruby-forum.com/u/malvadomx)\
**Post date:** [June 17, 2010, 11:00pm UTC](https://www.ruby-forum.com/t/chunked-transfer/190326/4 "2010-06-17T23:00:44Z")

</div>

Sergio L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi.
> 
> Does mongrel support ‘chunked’ transfer encoding ?

Hi Sergio,

Not for requests, but of course it can generate chunked responses.

> We are sending images from a J2ME app, but do not seem to be able to read  
> the entire xml message that gets sent from the mobile device. The message is  
> posted to our RoR app running on a mongrel server.

\<shameless plug(s)\>

Rainbows![1] and Zbatery[2] both support chunked requests using the HTTP  
parser found in Unicorn[3] (which is descended from the Mongrel parser).

The ThreadSpawn[4] concurrency model with Rainbows!/Zbatery is similar  
to Mongrel, and can handle slow clients reasonably well. Both Rainbows!  
and Zbatery work great on \*nix, and Zbatery _may_ work on Win32 as well.

Unicorn itself is only designed to run behind nginx, so it is wasteful  
if you’re dealing with slow connections from a J2ME mobile app. I don’t  
remember nginx being able to parse chunked requests, but that may have  
changed. The added benefit of Rainbows!/Zbatery is they can read and  
process the chunked request in your app incrementally while it’s being  
uploaded.

[1] [http://rainbows.rubyforge.org/](http://rainbows.rubyforge.org/)  
[2] [http://zbatery.bogomip.org/](http://zbatery.bogomip.org/) (no, not a typo 🙂  
[3] [http://unicorn.bogomips.org/](http://unicorn.bogomips.org/)  
[4] [http://rainbows.rubyforge.org/Rainbows/ThreadSpawn.html](http://rainbows.rubyforge.org/Rainbows/ThreadSpawn.html)

\</shameless plug(s)\>
