[PATCH] SPDY: fix support for headers with multiple values

Maxim Dounin mdounin at mdounin.ru
Wed Jul 9 01:55:17 UTC 2014


Hello!

On Tue, Jul 08, 2014 at 02:07:27PM +0400, Valentin V. Bartenev wrote:

> On Tuesday 08 July 2014 13:44:30 Valentin V. Bartenev wrote:
> > On Tuesday 08 July 2014 02:29:21 Piotr Sikora wrote:
> > > # HG changeset patch
> > > # User Piotr Sikora <piotr at cloudflare.com>
> > > # Date 1404811064 25200
> > > #      Tue Jul 08 02:17:44 2014 -0700
> > > # Node ID 0d4b16900e55bc3495fb63b3e93f06cac690497b
> > > # Parent  a680bf4dddd5c4b106419e3dfb0264815c401275
> > > SPDY: fix support for headers with multiple values.
> > > 
> > > Split SPDY header with multiple, NULL-separated values:
> > > 
> > >     cookie: foo\0bar
> > > 
> > > into two separate HTTP headers with the same name:
> > > 
> > >     cookie: foo
> > >     cookie: bar
> > > 
> > > Even though the logic for this behavior already existed
> > > in the source code, it doesn't look that it ever worked
> > > and SPDY streams with such headers were simply rejected.
> > > 
> > > Signed-off-by: Piotr Sikora <piotr at cloudflare.com>
> > > 
> > > diff -r a680bf4dddd5 -r 0d4b16900e55 src/http/ngx_http_spdy.c
> > > --- a/src/http/ngx_http_spdy.c	Sat Jul 05 23:29:47 2014 +0400
> > > +++ b/src/http/ngx_http_spdy.c	Tue Jul 08 02:17:44 2014 -0700
> > > @@ -2584,6 +2584,8 @@ ngx_http_spdy_parse_header(ngx_http_requ
> > >                  r->header_end = p;
> > >                  r->header_in->pos = p + 1;
> > >  
> > > +                r->state = state;
> > > +
> > >                  return NGX_OK;
> > >              }
> > >  
> > 
> > Nice catch, thank you.
> > 
> > Maxim, do you approve this for push?
> > 
> [..]
> 
> Probably, it's better to use constant here (like r->state = 0 in
> the same function):
> 
> diff -r 9d3a9c45fc43 src/http/ngx_http_spdy.c
> --- a/src/http/ngx_http_spdy.c  Tue Jul 01 20:52:08 2014 +0400
> +++ b/src/http/ngx_http_spdy.c  Tue Jul 08 13:55:52 2014 +0400
> @@ -2584,6 +2584,8 @@ ngx_http_spdy_parse_header(ngx_http_requ
>                  r->header_end = p;
>                  r->header_in->pos = p + 1;
>  
> +                r->state = sw_value;
> +
>                  return NGX_OK;
>              }

Feel free to commit whichever version you prefer, I'm fine with 
both of them.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list