From: Ryan Bloom Date: Mon, 25 Feb 2002 06:54:40 +0000 (+0000) Subject: I learned about AP_MODE_EXHAUSTIVE while reading some of the new filter X-Git-Tag: 2.0.33~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b98728f9203bf019d59fb87950eebb3493df648c;p=apache I learned about AP_MODE_EXHAUSTIVE while reading some of the new filter code earlier today. With this mode, the Perchild MPM can finally be fixed to work with filters. I have changed a comment in the core to make it clear that this mode is required, but I have mentioned how dangerous this mode is. Also add a comment to STATUS about my plans. Hopefully I'll have some time this week to hack through the MPM. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93565 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 3d7cb94df8..9eb5038b17 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2002/02/24 16:20:01 $] +Last modified at [$Date: 2002/02/25 06:54:40 $] Release: @@ -127,6 +127,13 @@ CURRENT VOTES: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * With AP_MODE_EXHAUSTIVE in the core, it is finally clear to me + how the Perchild MPM should be re-written. It hasn't worked + correctly since filters were added because it wasn't possible to + get the content that had already been written and the socket at + the same time. This mode lets us do that, so the MPM can be + fixed. + * htpasswd blindly processes the file you give it, and does no sanity checking before totally corrupting whatever file it was you thought you had. It should check the input file and bail diff --git a/server/core.c b/server/core.c index 07fbd7bf11..899f3ffdd3 100644 --- a/server/core.c +++ b/server/core.c @@ -3266,14 +3266,16 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, } } - /* If readbytes is -1, we want to just read everything until the end - * of the brigade, which in this case means the end of the socket. To - * do this, we loop through the entire brigade, until the socket is - * exhausted, at which point, it will automagically remove itself from - * the brigade. - * ### No one in their right mind should be calling this with -1. - * This is just an all-around bad idea. We may be better off by - * just closing the socket. Determine whether anyone uses this. + /* If mode is EXHAUSTIVE, we want to just read everything until the end + * of the brigade, which in this case means the end of the socket. + * To do this, we attach the brigade that has currently been setaside to + * the brigade that was passed down, and send that brigade back. + * + * NOTE: This is VERY dangerous to use, and should only be done with + * extreme caution. However, the Perchild MPM needs this feature + * if it is ever going to work correctly again. With this, the Perchild + * MPM can easily request the socket and all data that has been read, + * which means that it can pass it to the correct child process. */ if (mode == AP_MODE_EXHAUSTIVE) { apr_bucket *e;