httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
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
amount.

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
again.

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
all."

Thoughts?

thx,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message