You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2008/07/01 00:01:42 UTC

Re: connobject.c broke with apr 1.3.2

Cyrille Froehlich wrote:
> Hi,
> 
>   Upgrading apr to the latest 1.3.2 broke the compilation of mod_python (I use
> mod_python 3.3.1 but this file is the same in svn). Since b is a bucket and bb
> the bucket brigade object, I suppose we must read APR_BRIGADE_SENTINEL(bb)
> instead of APR_BRIGADE_SENTINEL(b). Any APR lib expert confirmation ?
> 
> diff -r -u -p mod_python-3.3.1.orig/src/connobject.c
> mod_python-3.3.1/src/connobject.c
> --- mod_python-3.3.1.orig/src/connobject.c      2008-06-25 16:16:41 +0200
> +++ mod_python-3.3.1/src/connobject.c   2008-06-25 16:20:32 +0200
> @@ -139,7 +139,7 @@ static PyObject * _conn_read(conn_rec *c
>      bytes_read = 0;
> 
>      while ((bytes_read < len || len == 0) &&
> -           !(b == APR_BRIGADE_SENTINEL(b) ||
> +           !(b == APR_BRIGADE_SENTINEL(bb) ||
>               APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b))) {
> 
>          const char *data;

According to Tom Donovan, the only reason this worked before was the fact
that both contain a .list member.  But you never should have passed a
bucket, so the existing code was (silently) broken.  Patch looks good.