Multi-line headers patch

Cliff Wells cliff at develix.com
Thu Aug 27 01:24:04 MSD 2009


On Wed, 2009-08-26 at 16:36 -0400, algorist wrote:
> Ok, not sure if this work is for naught... Here is the patch file (whitespace is dropped by the form):
> 
> --- nginx-0.7.61-clean/src/http/ngx_http_parse.c	2009-04-23 16:38:59.000000000 +0000
> +++ nginx-0.7.61/src/http/ngx_http_parse.c	2009-08-12 18:50:47.000000000 +0000
> @@ -699,6 +699,14 @@
>  }
>  
> 
> +/* helper method that looks ahead one character to determine if the header is multiline */
> +u_char
> +next_char_indicates_multiline_header(u_char *p, ngx_buf_t *b) {
> +    u_char next_char = ((p+1) < b->last ? *(p+1) : 0);
> +    return (next_char && (next_char == ' ' || next_char == '\t'));

Not to nitpick, but couldn't the last line just be

       return (next_char == ' ' || next_char == '\t');

since clearly next_char != 0 in either case?

Cliff


-- 
http://www.google.com/search?q=vonage+sucks






More information about the nginx mailing list