[web-devel] HTTP pipelining and constant space usage?
Bardur Arantsson
spam at scientician.net
Wed Sep 18 19:40:11 CEST 2013
On 2013-09-18 17:45, Jeremy Shaw wrote:
> The problem is that the client is allowed to send an unlimited number of
> Requests before it bothers to read any Responses.
>
> If your server uses the model of read a single Request and send the
> Response entirely before moving onto the next Request, then you could
> potentially deadlock because the client is still in the sending phase and
> you are blocked on a write().
>
> So, we are basically forced to read all the Requests before sending a
> Response? But, then the client could perform a DoS by sending millions of
> requests..
>
> Any thoughts on how best to handle this?
Implement SPDY instead or wait for HTTP 2.0 :).
This is of course somewhat tongue-in-cheek, but really HTTP pipelining
is notoriously complicated to get right and not sufficient for actually
achieving what one wants. Multiplexing as in SPDY is much saner and
based on actual use cases, admittedly from the "browser" portion of the
HTTP client ecosystem, but actual use cases nonetheless.
(Not saying that SDPY is all roses, btw, but that's irrelevant to this
discussion.)
If it were me, I'd simply not support HTTP pipelining.
More information about the web-devel
mailing list