comparison src/http/modules/perl/nginx.xs @ 8026:8b3860b52bb3

Perl: all known input headers are handled identically. As all known input headers are now linked lists, these are now handled identically. In particular, this makes it possible to access properly combined values of headers not specifically handled previously, such as "Via" or "Connection".
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 30 May 2022 21:25:36 +0300
parents ef6a3a99a81a
children ca78312db071
comparison
equal deleted inserted replaced
8025:c263f9ffa1fd 8026:8b3860b52bb3
302 302
303 if (hh) { 303 if (hh) {
304 304
305 if (hh->offset == offsetof(ngx_http_headers_in_t, cookie)) { 305 if (hh->offset == offsetof(ngx_http_headers_in_t, cookie)) {
306 sep = ';'; 306 sep = ';';
307 goto multi; 307
308 } 308 } else {
309 #if (NGX_HTTP_X_FORWARDED_FOR)
310 if (hh->offset == offsetof(ngx_http_headers_in_t, x_forwarded_for)) {
311 sep = ','; 309 sep = ',';
312 goto multi; 310 }
313 }
314 #endif
315
316 ph = (ngx_table_elt_t **) ((char *) &r->headers_in + hh->offset);
317
318 if (*ph) {
319 ngx_http_perl_set_targ((*ph)->value.data, (*ph)->value.len);
320
321 goto done;
322 }
323
324 XSRETURN_UNDEF;
325
326 multi:
327
328 /* Cookie, X-Forwarded-For */
329 311
330 ph = (ngx_table_elt_t **) ((char *) &r->headers_in + hh->offset); 312 ph = (ngx_table_elt_t **) ((char *) &r->headers_in + hh->offset);
331 313
332 if (*ph == NULL) { 314 if (*ph == NULL) {
333 XSRETURN_UNDEF; 315 XSRETURN_UNDEF;