comparison src/http/modules/ngx_http_fastcgi_handler.c @ 32:da8c190bdaba NGINX_0_1_16

nginx 0.1.16 *) Bugfix: if the response were transferred by chunks, then on the HEAD request the final chunk was issued. *) Bugfix: the "Connection: keep-alive" header were issued, even if the keepalive_timeout directive forbade the keep-alive use. *) Bugfix: the errors in the ngx_http_fastcgi_module caused the segmentation faults. *) Bugfix: the compressed response encrypted by SSL may not transferred complete. *) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPSUH, and TCP_CORK options, are not used for the unix domain sockets. *) Feature: the rewrite directive supports the arguments rewriting. *) Bugfix: the response code 400 was returned for the POST request with the "Content-Length: 0" header; bug appeared in 0.1.14.
author Igor Sysoev <http://sysoev.ru>
date Tue, 25 Jan 2005 00:00:00 +0300
parents e1ada20fc595
children aab2ea7c0458
comparison
equal deleted inserted replaced
31:1b17dd824438 32:da8c190bdaba
1383 1383
1384 static ngx_int_t ngx_http_fastcgi_input_filter(ngx_event_pipe_t *p, 1384 static ngx_int_t ngx_http_fastcgi_input_filter(ngx_event_pipe_t *p,
1385 ngx_buf_t *buf) 1385 ngx_buf_t *buf)
1386 { 1386 {
1387 ngx_int_t rc; 1387 ngx_int_t rc;
1388 ngx_buf_t *b; 1388 ngx_buf_t *b, **prev;
1389 ngx_str_t line; 1389 ngx_str_t line;
1390 ngx_chain_t *cl; 1390 ngx_chain_t *cl;
1391 ngx_http_request_t *r; 1391 ngx_http_request_t *r;
1392 ngx_http_fastcgi_ctx_t *f; 1392 ngx_http_fastcgi_ctx_t *f;
1393 1393
1397 1397
1398 r = p->input_ctx; 1398 r = p->input_ctx;
1399 f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module); 1399 f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);
1400 1400
1401 b = NULL; 1401 b = NULL;
1402 prev = &buf->shadow;
1402 1403
1403 f->pos = buf->pos; 1404 f->pos = buf->pos;
1404 f->last = buf->last; 1405 f->last = buf->last;
1405 1406
1406 for ( ;; ) { 1407 for ( ;; ) {
1508 } 1509 }
1509 1510
1510 ngx_memzero(b, sizeof(ngx_buf_t)); 1511 ngx_memzero(b, sizeof(ngx_buf_t));
1511 1512
1512 b->pos = f->pos; 1513 b->pos = f->pos;
1513 b->shadow = buf; 1514 b->start = buf->start;
1515 b->end = buf->end;
1514 b->tag = p->tag; 1516 b->tag = p->tag;
1515 b->temporary = 1; 1517 b->temporary = 1;
1516 b->recycled = 1; 1518 b->recycled = 1;
1517 buf->shadow = b; 1519
1520 *prev = b;
1521 prev = &b->shadow;
1518 1522
1519 if (!(cl = ngx_alloc_chain_link(p->pool))) { 1523 if (!(cl = ngx_alloc_chain_link(p->pool))) {
1520 return NGX_ERROR; 1524 return NGX_ERROR;
1521 } 1525 }
1522 1526
1523 cl->buf = b; 1527 cl->buf = b;
1524 cl->next = NULL; 1528 cl->next = NULL;
1529
1530 /* STUB */ b->num = buf->num;
1525 1531
1526 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, "input buf #%d", b->num); 1532 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, "input buf #%d", b->num);
1527 1533
1528 ngx_chain_add_link(p->in, p->last_in, cl); 1534 ngx_chain_add_link(p->in, p->last_in, cl);
1529 1535
1561 break; 1567 break;
1562 1568
1563 } 1569 }
1564 1570
1565 if (b) { 1571 if (b) {
1572 b->shadow = buf;
1566 b->last_shadow = 1; 1573 b->last_shadow = 1;
1574
1575 return NGX_OK;
1576 }
1577
1578 /* there is no data record in the buf, add it to free chain */
1579
1580 if (ngx_event_pipe_add_free_buf(p, buf) != NGX_OK) {
1581 return NGX_ERROR;
1567 } 1582 }
1568 1583
1569 return NGX_OK; 1584 return NGX_OK;
1570 } 1585 }
1571 1586