comparison src/http/v2/ngx_http_v2.c @ 6762:078f17b2535b stable-1.10

HTTP/2: avoid sending output queue if there's nothing to send. Particularly this fixes alerts on OS X and NetBSD systems when HTTP/2 is configured over plain TCP sockets. On these systems calling writev() with no data leads to EINVAL errors being logged as "writev() failed (22: Invalid argument) while processing HTTP/2 connection".
author Valentin Bartenev <vbart@nginx.com>
date Tue, 19 Jul 2016 20:30:21 +0300
parents ee43fa9aff66
children e78eca6bfaf0
comparison
equal deleted inserted replaced
6761:73e62bd2ce69 6762:078f17b2535b
408 return; 408 return;
409 } 409 }
410 410
411 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http2 write handler"); 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
415 if (wev->timer_set) {
416 ngx_del_timer(wev);
417 }
418
419 ngx_http_v2_handle_connection(h2c);
420 return;
421 }
422
413 h2c->blocked = 1; 423 h2c->blocked = 1;
414 424
415 rc = ngx_http_v2_send_output_queue(h2c); 425 rc = ngx_http_v2_send_output_queue(h2c);
416 426
417 if (rc == NGX_ERROR) { 427 if (rc == NGX_ERROR) {