comparison src/http/modules/ngx_http_gzip_static_module.c @ 8031:d26db4f82d7d

All known output headers can be linked lists now. The h->next pointer properly provided as NULL in all cases where known output headers are added. Note that there are 3rd party modules which might not do this, and it might be risky to rely on this for arbitrary headers.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 30 May 2022 21:25:45 +0300
parents 5116cfea1e9a
children c7e103acb409
comparison
equal deleted inserted replaced
8030:cdc2724858ca 8031:d26db4f82d7d
240 if (h == NULL) { 240 if (h == NULL) {
241 return NGX_HTTP_INTERNAL_SERVER_ERROR; 241 return NGX_HTTP_INTERNAL_SERVER_ERROR;
242 } 242 }
243 243
244 h->hash = 1; 244 h->hash = 1;
245 h->next = NULL;
245 ngx_str_set(&h->key, "Content-Encoding"); 246 ngx_str_set(&h->key, "Content-Encoding");
246 ngx_str_set(&h->value, "gzip"); 247 ngx_str_set(&h->value, "gzip");
247 r->headers_out.content_encoding = h; 248 r->headers_out.content_encoding = h;
248 249
249 /* we need to allocate all before the header would be sent */ 250 /* we need to allocate all before the header would be sent */