httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r573903 - in /httpd/httpd/trunk: CHANGES modules/proxy/proxy_util.c
Date Sun, 09 Sep 2007 09:51:37 GMT


On 09/08/2007 10:29 PM, niq@apache.org wrote:
> Author: niq
> Date: Sat Sep  8 13:29:14 2007
> New Revision: 573903
> 
> URL: http://svn.apache.org/viewvc?rev=573903&view=rev
> Log:
> mod_proxy: Don't lose bytes when a response line arrives in small chunks.
> PR 40894
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/modules/proxy/proxy_util.c
> 
>
> Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=573903&r1=573902&r2=573903&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
> +++ httpd/httpd/trunk/modules/proxy/proxy_util.c Sat Sep  8 13:29:14 2007
> @@ -994,12 +994,14 @@
>                      len = (bufflen-1)-(pos-buff);
>                  }
>                  if (len > 0) {
> -                    pos = apr_cpystrn(pos, response, len);
> +                    memcpy(pos, response, len);
> +                    pos += len;

I am slightly confused here: IMHO apr_cpystrn does exactly what you do here
(it terminates pos with \0 and sets the pointer of pos to the terminating \0)
But it avoids reading over a possible terminating \0 in response which seems
good to me.

Regards

RĂ¼diger

Mime
View raw message