Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_fastcgi_module.c @ 5610:b246018860a2 stable-1.4
FastCGI: f->split_parts reset on request start.
Additionally, make sure to check for errors from ngx_http_parse_header_line()
call after joining saved parts. There shouldn't be any errors, though
check may help to catch bugs like missing f->split_parts reset.
Reported by Lucas Molas.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 17 Mar 2014 15:34:36 +0400 |
parents | 44025ae9fc67 |
children |
comparison
equal
deleted
inserted
replaced
5609:5ea3bfb4989e | 5610:b246018860a2 |
---|---|
1193 | 1193 |
1194 f->state = ngx_http_fastcgi_st_version; | 1194 f->state = ngx_http_fastcgi_st_version; |
1195 f->fastcgi_stdout = 0; | 1195 f->fastcgi_stdout = 0; |
1196 f->large_stderr = 0; | 1196 f->large_stderr = 0; |
1197 | 1197 |
1198 if (f->split_parts) { | |
1199 f->split_parts->nelts = 0; | |
1200 } | |
1201 | |
1198 r->state = 0; | 1202 r->state = 0; |
1199 | 1203 |
1200 return NGX_OK; | 1204 return NGX_OK; |
1201 } | 1205 } |
1202 | 1206 |
1473 | 1477 |
1474 f->split_parts->nelts = 0; | 1478 f->split_parts->nelts = 0; |
1475 | 1479 |
1476 rc = ngx_http_parse_header_line(r, &buf, 1); | 1480 rc = ngx_http_parse_header_line(r, &buf, 1); |
1477 | 1481 |
1482 if (rc != NGX_OK) { | |
1483 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, | |
1484 "invalid header after joining " | |
1485 "FastCGI records"); | |
1486 return NGX_ERROR; | |
1487 } | |
1488 | |
1478 h->key.len = r->header_name_end - r->header_name_start; | 1489 h->key.len = r->header_name_end - r->header_name_start; |
1479 h->key.data = r->header_name_start; | 1490 h->key.data = r->header_name_start; |
1480 h->key.data[h->key.len] = '\0'; | 1491 h->key.data[h->key.len] = '\0'; |
1481 | 1492 |
1482 h->value.len = r->header_end - r->header_start; | 1493 h->value.len = r->header_end - r->header_start; |