comparison src/http/modules/ngx_http_fastcgi_module.c @ 512:6557aef8a4b2 NGINX_0_8_8

nginx 0.8.8 *) Bugfix: in handling FastCGI headers split in records. *) Bugfix: a segmentation fault occurred in worker process, if a request was handled in two proxied or FastCGIed locations and a caching was enabled in the first location; the bug had appeared in 0.8.7.
author Igor Sysoev <http://sysoev.ru>
date Mon, 10 Aug 2009 00:00:00 +0400
parents 24b676623d4f
children 43cc6f0b77ce
comparison
equal deleted inserted replaced
511:e8f9a06185f3 512:6557aef8a4b2
1063 1063
1064 1064
1065 static ngx_int_t 1065 static ngx_int_t
1066 ngx_http_fastcgi_process_header(ngx_http_request_t *r) 1066 ngx_http_fastcgi_process_header(ngx_http_request_t *r)
1067 { 1067 {
1068 u_char *p, *start, *last, *part_start; 1068 u_char *p, *start, *last, *part_start, *part_end;
1069 size_t size; 1069 size_t size;
1070 ngx_str_t *status_line, line, *pattern; 1070 ngx_str_t *status_line, line, *pattern;
1071 ngx_int_t rc, status; 1071 ngx_int_t rc, status;
1072 ngx_buf_t buf; 1072 ngx_buf_t buf;
1073 ngx_uint_t i; 1073 ngx_uint_t i;
1235 } 1235 }
1236 1236
1237 for ( ;; ) { 1237 for ( ;; ) {
1238 1238
1239 part_start = u->buffer.pos; 1239 part_start = u->buffer.pos;
1240 part_end = u->buffer.last;
1240 1241
1241 rc = ngx_http_parse_header_line(r, &u->buffer, 1); 1242 rc = ngx_http_parse_header_line(r, &u->buffer, 1);
1242 1243
1243 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1244 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1244 "http fastcgi parser: %d", rc); 1245 "http fastcgi parser: %d", rc);
1435 } 1436 }
1436 1437
1437 part = ngx_array_push(f->split_parts); 1438 part = ngx_array_push(f->split_parts);
1438 1439
1439 part->start = part_start; 1440 part->start = part_start;
1440 part->end = u->buffer.last; 1441 part->end = part_end;
1442
1443 if (u->buffer.pos < u->buffer.last) {
1444 continue;
1445 }
1441 1446
1442 return NGX_AGAIN; 1447 return NGX_AGAIN;
1443 } 1448 }
1444 } 1449 }
1445 1450