Le 14/02/2017 à 17:43, yla...@apache.org a écrit :
Author: ylavic
Date: Tue Feb 14 16:43:25 2017
New Revision: 1782986

URL:http://svn.apache.org/viewvc?rev=1782986&view=rev
Log:
util_filter: better ap_pass_brigade() vs empty brigades.

Modified:
     httpd/httpd/trunk/server/util_filter.c

Modified: httpd/httpd/trunk/server/util_filter.c
URL:http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_filter.c?rev=1782986&r1=1782985&r2=1782986&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_filter.c (original)
+++ httpd/httpd/trunk/server/util_filter.c Tue Feb 14 16:43:25 2017
@@ -584,9 +584,9 @@ AP_DECLARE(apr_status_t) ap_pass_brigade
                                           apr_bucket_brigade *bb)
  {
      if (next) {
-        apr_bucket *e;
+        apr_bucket *e = APR_BRIGADE_LAST(bb);
- if ((e = APR_BRIGADE_LAST(bb)) && APR_BUCKET_IS_EOS(e) && next->r) {
+        if (e != APR_BRIGADE_SENTINEL(bb) && APR_BUCKET_IS_EOS(e) && next->r) {
              /* This is only safe because HTTP_HEADER filter is always in
               * the filter stack.   This ensures that there is ALWAYS a
               * request-based filter that we can attach this to.  If the

Hi,

I don't really understand the change above.

The commit description is clear. 'ap_pass_brigade' should deal better with empty brigades.

However, if the last bucket is an EOS bucket, how could it be a sentinel?
My understanding is that this change is a no-op, but I may have missed something.

What is the rational for it?

CJ

Reply via email to