diff -r 6f69e3c0f780 -r a7e7afe80319 src/http/v2/ngx_http_v2.c
|
a
|
b
|
ngx_http_v2_write_handler(ngx_event_t *w
|
| 410 | 410 | |
| 411 | 411 | ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http2 write handler"); |
| 412 | 412 | |
| | 413 | if (h2c->last_out == NULL && !c->buffered) { |
| | 414 | ngx_http_v2_handle_connection(h2c); |
| | 415 | return; |
| | 416 | } |
| | 417 | |
| 413 | 418 | h2c->blocked = 1; |
| 414 | 419 | |
| 415 | 420 | rc = ngx_http_v2_send_output_queue(h2c); |
| … |
… |
ngx_http_v2_send_output_queue(ngx_http_v
|
| 468 | 473 | wev = c->write; |
| 469 | 474 | |
| 470 | 475 | if (!wev->ready) { |
| 471 | | return NGX_OK; |
| | 476 | return NGX_AGAIN; |
| 472 | 477 | } |
| 473 | 478 | |
| 474 | 479 | cl = NULL; |
| … |
… |
ngx_http_v2_send_output_queue(ngx_http_v
|
| 488 | 493 | out->blocked, out->length); |
| 489 | 494 | } |
| 490 | 495 | |
| 491 | | cl = c->send_chain(c, cl, 0); |
| 492 | | |
| 493 | | if (cl == NGX_CHAIN_ERROR) { |
| | 496 | if (c->send_chain(c, cl, 0) == NGX_CHAIN_ERROR) { |
| 494 | 497 | goto error; |
| 495 | 498 | } |
| 496 | 499 | |
| … |
… |
ngx_http_v2_send_output_queue(ngx_http_v
|
| 539 | 542 | c->tcp_nodelay = NGX_TCP_NODELAY_SET; |
| 540 | 543 | } |
| 541 | 544 | |
| 542 | | if (cl) { |
| 543 | | ngx_add_timer(wev, clcf->send_timeout); |
| 544 | | |
| 545 | | } else { |
| 546 | | if (wev->timer_set) { |
| 547 | | ngx_del_timer(wev); |
| 548 | | } |
| 549 | | } |
| 550 | | |
| 551 | 545 | for ( /* void */ ; out; out = fn) { |
| 552 | 546 | fn = out->next; |
| 553 | 547 | |
| … |
… |
ngx_http_v2_send_output_queue(ngx_http_v
|
| 572 | 566 | |
| 573 | 567 | h2c->last_out = frame; |
| 574 | 568 | |
| | 569 | if (frame || (c->buffered && !wev->ready)) { |
| | 570 | ngx_add_timer(wev, clcf->send_timeout); |
| | 571 | return NGX_AGAIN; |
| | 572 | } |
| | 573 | |
| | 574 | if (wev->timer_set) { |
| | 575 | ngx_del_timer(wev); |
| | 576 | } |
| | 577 | |
| 575 | 578 | return NGX_OK; |
| 576 | 579 | |
| 577 | 580 | error: |
| … |
… |
error:
|
| 589 | 592 | static void |
| 590 | 593 | ngx_http_v2_handle_connection(ngx_http_v2_connection_t *h2c) |
| 591 | 594 | { |
| 592 | | ngx_connection_t *c; |
| | 595 | ngx_int_t rc; |
| | 596 | ngx_connection_t *c; |
| 593 | 597 | ngx_http_v2_srv_conf_t *h2scf; |
| 594 | 598 | |
| 595 | 599 | if (h2c->last_out || h2c->processing) { |
| … |
… |
ngx_http_v2_handle_connection(ngx_http_v
|
| 604 | 608 | } |
| 605 | 609 | |
| 606 | 610 | if (c->buffered) { |
| 607 | | return; |
| | 611 | h2c->blocked = 1; |
| | 612 | |
| | 613 | rc = ngx_http_v2_send_output_queue(h2c); |
| | 614 | |
| | 615 | h2c->blocked = 0; |
| | 616 | |
| | 617 | if (rc != NGX_OK) { |
| | 618 | if (rc == NGX_ERROR) { |
| | 619 | ngx_http_close_connection(c); |
| | 620 | } |
| | 621 | |
| | 622 | return; |
| | 623 | } |
| 608 | 624 | } |
| 609 | 625 | |
| 610 | 626 | h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx, |
diff -r 6f69e3c0f780 -r a7e7afe80319 src/http/v2/ngx_http_v2_filter_module.c
|
a
|
b
|
ngx_http_v2_header_filter(ngx_http_reque
|
| 165 | 165 | return NGX_OK; |
| 166 | 166 | } |
| 167 | 167 | |
| | 168 | fc = r->connection; |
| | 169 | |
| | 170 | if (fc->error) { |
| | 171 | return NGX_ERROR; |
| | 172 | } |
| | 173 | |
| 168 | 174 | if (r->method == NGX_HTTP_HEAD) { |
| 169 | 175 | r->header_only = 1; |
| 170 | 176 | } |
| … |
… |
ngx_http_v2_header_filter(ngx_http_reque
|
| 255 | 261 | len += 1 + ngx_http_v2_literal_size("Wed, 31 Dec 1986 18:00:00 GMT"); |
| 256 | 262 | } |
| 257 | 263 | |
| 258 | | fc = r->connection; |
| 259 | | |
| 260 | 264 | if (r->headers_out.location && r->headers_out.location->value.len) { |
| 261 | 265 | |
| 262 | 266 | if (r->headers_out.location->value.data[0] == '/') { |