httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <>
Subject ap_discard_request_body() problems
Date Fri, 19 Nov 1999 00:44:20 GMT
It seems that ap_discard_request_body() could really bung things up if it
happens to be called twice. Each time it is called, it resets how much
data needs to be read from the client. Then it proceeds to read that

Okay, fine: make sure to call it only once.

Well... that is quite difficult. The comments in the source encourage
placing it at the top of your handler if you don't have a body. However,
if you return something other than DONE from your handle (e.g.
HTTP_NOT_FOUND), then ap_die() will *also* call it.

Oh, ick. Just thought of a related problem. Let's say that I consume the
request body, parse it, and return an error. Oops.
ap_discard_request_body() will get called and tried to read that input

I think the proper resolution is to allow ap_discard_request_body() to do
nothing if all input has been read. However, I'm not clear on what
variables in the request record are used to determine "okay, we've got it



Greg Stein,

View raw message