On Dec 31, 2005, at 6:50 PM, Roy T. Fielding wrote:

The nonblocking yield should happen inside ap_rgetline (or its
replacement), not in the calling routine.  The thread has nothing
to do until that call is finished or it times out.

On the contrary, the thread has some very important work to do before
that call finishes or times out: it has other connections to process. If
the thread waits until the ap_rgetline completes, a server configuration
sized for multiple threads per connection will be vulnerable to a trivially
implementable DoS.

 In any case,
this code should be independent of the MPM and no MPM is going
to do something useful with a partial HTTP request.

I say -1 to adding the input buffer variables to the request_rec.
Those variables can be local to the input loop.

Are you proposing that the buffers literally become local variables?
That generally won't work; the input loop isn't necessarily contained
within a single function call, and the reading of a single request's
input can cross threads.

It would be feasible to build up the pending request in a structure
other than the request_rec, so that ap_read_async_request() can
operate on, say, an ap_partial_request_t instead of a request_rec.
My preference so far, though, has been to leave the responsibility
for knowing how to parse request headers encapsulated within
the request_rec and its associated "methods."

Brian

Reply via email to