httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: [PATCH] followup with EOC bucket type
Date Mon, 29 Mar 2004 19:46:59 GMT
On Fri, Mar 26, 2004 at 12:01:30PM -0800, Mathihalli, Madhusudan wrote:
> Hello,
> 	Should we just ignore the rest of the processing in
> 	core_output_filter after deleting the EOC bucket ?

Yes, I think so, but by not leaving last_e pointing at a deleted bucket
it can be done without the extra variable, e.g.:

Index: server/core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.270
diff -u -r1.270 core.c
--- server/core.c	25 Mar 2004 14:27:27 -0000	1.270
+++ server/core.c	29 Mar 2004 19:42:16 -0000
@@ -3873,12 +3873,9 @@
         {
             /* keep track of the last bucket processed */
             last_e = e;
-            if (APR_BUCKET_IS_EOS(e)) {
+            if (APR_BUCKET_IS_EOS(e) || AP_BUCKET_IS_EOC(e)) {
                 break;
             }
-            if (AP_BUCKET_IS_EOC(e)) {
-                apr_bucket_delete(e);
-            }
             else if (APR_BUCKET_IS_FLUSH(e)) {
                 if (e != APR_BRIGADE_LAST(b)) {
                     more = apr_brigade_split(b, APR_BUCKET_NEXT(e));
@@ -4034,7 +4031,8 @@
         /* Completed iterating over the brigade, now determine if we want
          * to buffer the brigade or send the brigade out on the network.
          *
-         * Save if we haven't accumulated enough bytes to send, and:
+         * Save if we haven't accumulated enough bytes to send, the connection
+         * is not about to be closed, and:
          *
          *   1) we didn't see a file, we don't have more passes over the
          *      brigade to perform,  AND we didn't stop at a FLUSH bucket.
@@ -4045,6 +4043,7 @@
          *       with the hope of concatenating with another response)
          */
         if (nbytes + flen < AP_MIN_BYTES_TO_WRITE
+            && !AP_BUCKET_IS_EOC(last_e)
             && ((!fd && !more && !APR_BUCKET_IS_FLUSH(last_e))
                 || (APR_BUCKET_IS_EOS(last_e)
                     && c->keepalive == AP_CONN_KEEPALIVE))) {

Mime
View raw message