Skip to content

Commit

Permalink
HTTP/2: refactored ngx_http_v2_send_output_queue().
Browse files Browse the repository at this point in the history
Now it returns NGX_AGAIN if there's still data to be sent.
  • Loading branch information
VBart committed Jul 19, 2016
1 parent 3b2f54b commit 3c81c08
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/http/v2/ngx_http_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ ngx_http_v2_send_output_queue(ngx_http_v2_connection_t *h2c)
wev = c->write;

if (!wev->ready) {
return NGX_OK;
return NGX_AGAIN;
}

cl = NULL;
Expand Down Expand Up @@ -549,15 +549,6 @@ ngx_http_v2_send_output_queue(ngx_http_v2_connection_t *h2c)
c->tcp_nodelay = NGX_TCP_NODELAY_SET;
}

if (!wev->ready) {
ngx_add_timer(wev, clcf->send_timeout);

} else {
if (wev->timer_set) {
ngx_del_timer(wev);
}
}

for ( /* void */ ; out; out = fn) {
fn = out->next;

Expand All @@ -582,6 +573,15 @@ ngx_http_v2_send_output_queue(ngx_http_v2_connection_t *h2c)

h2c->last_out = frame;

if (!wev->ready) {
ngx_add_timer(wev, clcf->send_timeout);
return NGX_AGAIN;
}

if (wev->timer_set) {
ngx_del_timer(wev);
}

return NGX_OK;

error:
Expand Down

0 comments on commit 3c81c08

Please sign in to comment.