[nginx] Free nginx: changed server name.

Maxim Dounin mdounin at mdounin.ru
Tue Feb 20 16:32:38 UTC 2024


Hello!

On Tue, Feb 20, 2024 at 04:22:57PM +0000, Daniel K. wrote:

> On 2/20/24 14:09, Maxim Dounin wrote:
> > diff --git a/src/http/v2/ngx_http_v2_filter_module.c b/src/http/v2/ngx_http_v2_filter_module.c
> > --- a/src/http/v2/ngx_http_v2_filter_module.c
> > +++ b/src/http/v2/ngx_http_v2_filter_module.c
> > @@ -115,12 +115,14 @@ ngx_http_v2_header_filter(ngx_http_reque
> >      ngx_http_core_srv_conf_t  *cscf;
> >      u_char                     addr[NGX_SOCKADDR_STRLEN];
> >  
> > -    static const u_char nginx[5] = "\x84\xaa\x63\x55\xe7";
> >  #if (NGX_HTTP_GZIP)
> >      static const u_char accept_encoding[12] =
> >          "\x8b\x84\x84\x2d\x69\x5b\x05\x44\x3c\x86\xaa\x6f";
> >  #endif
> >  
> > +    static size_t nginx_name_len = ngx_http_v2_literal_size(NGINX_NAME);
> > +    static u_char nginx_name[ngx_http_v2_literal_size(NGINX_VER)];
> 
> It certainly works, but we could save a few bytes by using
> NGINX_NAME/NGINX_NAME above...
> 
> 
> >      static size_t nginx_ver_len = ngx_http_v2_literal_size(NGINX_VER);
> >      static u_char nginx_ver[ngx_http_v2_literal_size(NGINX_VER)];
> 
> ... just as we have NGINX_VER/NGINX_VER here.

Fixed, thanks for catching this.

-- 
Maxim Dounin
http://mdounin.ru/



More information about the nginx-devel mailing list