Mercurial > hg > nginx-quic
comparison src/http/v2/ngx_http_v2.c @ 6641:b5d1c17181ca
HTTP/2: refactored ngx_http_v2_send_output_queue().
Now it returns NGX_AGAIN if there's still data to be sent.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Tue, 19 Jul 2016 20:34:02 +0300 |
parents | e78eca6bfaf0 |
children | 72282dd5884e |
comparison
equal
deleted
inserted
replaced
6640:e78eca6bfaf0 | 6641:b5d1c17181ca |
---|---|
476 } | 476 } |
477 | 477 |
478 wev = c->write; | 478 wev = c->write; |
479 | 479 |
480 if (!wev->ready) { | 480 if (!wev->ready) { |
481 return NGX_OK; | 481 return NGX_AGAIN; |
482 } | 482 } |
483 | 483 |
484 cl = NULL; | 484 cl = NULL; |
485 out = NULL; | 485 out = NULL; |
486 | 486 |
547 } | 547 } |
548 | 548 |
549 c->tcp_nodelay = NGX_TCP_NODELAY_SET; | 549 c->tcp_nodelay = NGX_TCP_NODELAY_SET; |
550 } | 550 } |
551 | 551 |
552 if (!wev->ready) { | |
553 ngx_add_timer(wev, clcf->send_timeout); | |
554 | |
555 } else { | |
556 if (wev->timer_set) { | |
557 ngx_del_timer(wev); | |
558 } | |
559 } | |
560 | |
561 for ( /* void */ ; out; out = fn) { | 552 for ( /* void */ ; out; out = fn) { |
562 fn = out->next; | 553 fn = out->next; |
563 | 554 |
564 if (out->handler(h2c, out) != NGX_OK) { | 555 if (out->handler(h2c, out) != NGX_OK) { |
565 out->blocked = 1; | 556 out->blocked = 1; |
579 out->next = frame; | 570 out->next = frame; |
580 frame = out; | 571 frame = out; |
581 } | 572 } |
582 | 573 |
583 h2c->last_out = frame; | 574 h2c->last_out = frame; |
575 | |
576 if (!wev->ready) { | |
577 ngx_add_timer(wev, clcf->send_timeout); | |
578 return NGX_AGAIN; | |
579 } | |
580 | |
581 if (wev->timer_set) { | |
582 ngx_del_timer(wev); | |
583 } | |
584 | 584 |
585 return NGX_OK; | 585 return NGX_OK; |
586 | 586 |
587 error: | 587 error: |
588 | 588 |