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: r580457 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_http.c
Date Fri, 28 Sep 2007 22:38:24 GMT


On 09/28/2007 08:50 PM, niq@apache.org wrote:
> Author: niq
> Date: Fri Sep 28 11:50:57 2007
> New Revision: 580457
> 
> URL: http://svn.apache.org/viewvc?rev=580457&view=rev
> Log:
> Fix processing of Connection headers in proxy
> PR 43509
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
> 

> Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_http.c?rev=580457&r1=580456&r2=580457&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/proxy/mod_proxy_http.c (original)
> +++ httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Fri Sep 28 11:50:57 2007
> @@ -98,29 +98,37 @@
>  }
>  
>  /* Clear all connection-based headers from the incoming headers table */
> -static void ap_proxy_clear_connection(apr_pool_t *p, apr_table_t *headers)
> +typedef struct foo {
> +    apr_pool_t *pool;
> +    apr_table_t *table;
> +} foo;

How about struct clear_conn instead of struct foo and
clear_conn_t instead of foo?

> +static int clear_conn_headers(void *data, const char *key, const char *val)
>  {
> +    apr_table_t *headers = ((foo*)data)->table;
> +    apr_pool_t *pool = ((foo*)data)->pool;
>      const char *name;
> -    char *next = apr_pstrdup(p, apr_table_get(headers, "Connection"));
> -
> -    apr_table_unset(headers, "Proxy-Connection");
> -    if (!next)
> -        return;
> -
> +    char *next = apr_pstrdup(pool, val);
>      while (*next) {
>          name = next;
>          while (*next && !apr_isspace(*next) && (*next != ',')) {
>              ++next;
>          }
>          while (*next && (apr_isspace(*next) || (*next == ','))) {
> -            *next = '\0';
> -            ++next;
> +            *next++ = '\0';

Maybe some brackets make it more clear what happens?

*(next++)  = '\0';

Regards

RĂ¼diger



Mime
View raw message