[Eventmachine-talk] DistribuStream released

Kirk Haines
Fri, 19 Oct 2007 10:30:17 -0000

On 10/19/07, Tony Arcieri <tony at clickcaster.com> wrote:

> We were also trying to use Kirk''s evented Mongrel at one point,
however it
> looks like due to the way the Mongrel API works we can''t use it
properly for
> what we want to do.  Mongrel has a method you call to synchronously consume
> the request body (for example, in a POST or PUT request), but in the
evented
> Mongrel this is stubbed out and the whole request has been consumed
> (including the body) before we even get access to the header information.
> We''re using the header information to authenticate file transfers,
so it''s
> somewhat pointless and wasteful if we can''t get access to that
information
> before the entire transfer has occurred.

I may be able to fix that.

> Francis, does your HTTP server let you check the header of a POST or >
PUT request before the body is consumed?

As written, no.  I have modified it so that as the request body is
read, a method is called that receives the POST/PUT data, but the
method to handle the request itself isn''t called until the state
machine reaches the DispatchState, and it doesn''t reach that until it
has finished reading the request.

I however, have been hacking the heck out of this thing, trying
different things with it, and I don''t see any reason why one
couldn''t
change it to call a method after the header has been parsed, but
before the body has been parsed.  Should be pretty trivial.


Kirk Haines