Hey Folks,

We believe we've found a bug in mod_proxy_html 2.5.2 that causes an
"Error in bucket read".  A patch is attached with verbose comments.

- Ryan
--- proxy_old/mod_proxy_html.c  2006-07-27 11:20:15.000000000 -0500
+++ proxy/mod_proxy_html.c      2006-07-27 11:22:09.000000000 -0500
@@ -858,7 +858,19 @@
         htmlParseChunk(ctxt->parser, buf, bytes, 0) ;
       }
     } else {
-      ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, "Error in bucket read") ;
+         /* 
+          * This is to fix the double comparison above, causing random "bucket
+          * read failed" errors.  This case was not checked before asserting 
that 
+          * there was an error.  If we hit this else, either there was an 
error in,
+          * the read, or this bucket was a metadata bucket.  If it was 
metadata, 
+          * it must be a FLUSH bucket, since we already checked for EOS above. 
 
+          * So, if it is not a FLUSH, then it was actually a read error.
+       */
+      if (! APR_BUCKET_IS_METADATA(b)) {
+           ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, "Error in bucket 
read");
+      } else if (! APR_BUCKET_IS_FLUSH(b)) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, "Unknown bucket type - 
ignoring.");
+      } 
     }
   }
   /*ap_fflush(ctxt->f->next, ctxt->bb) ;        // uncomment for debug */

Attachment: signature.asc
Description: Digital signature

Reply via email to