since APR_BRIGADE_EMPTY() assumes a non-empty brigade, we have to check
before invoking that macro
since APR_BRIGADE_EMPTY() can make a brigade empty, we have to check
after invoking that macro
An obvious variation of this fix would be to change APR_BRIGADE_NORMALIZE()
to deal with empty brigades.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93293
13f79535-47bb-0310-9956-
ffa450edef68
APR_BRIGADE_INSERT_TAIL(ctx->b, e);
net->in_ctx = ctx;
}
-
+ else if (APR_BRIGADE_EMPTY(ctx->b)) {
+ return APR_EOF;
+ }
+
/* ### This is bad. */
APR_BRIGADE_NORMALIZE(ctx->b);
- /* check for empty brigade *AFTER* APR_BRIGADE_NORMALIZE()
+ /* check for empty brigade again *AFTER* APR_BRIGADE_NORMALIZE()
* If we have lost our socket bucket (see above), we are EOF.
*
* Ideally, this should be returning SUCCESS with EOS bucket, but