comparison src/http/ngx_http_upstream.c @ 7166:a762ddf22dbb

Upstream: flush low-level buffers on write retry. If the data to write is bigger than what the socket can send, and the reminder is smaller than NGX_SSL_BUFSIZE, then SSL_write() fails with SSL_ERROR_WANT_WRITE. The reminder of payload however is successfully copied to the low-level buffer and all the output chain buffers are flushed. This means that retry logic doesn't work because ngx_http_upstream_process_non_buffered_request() checks only if there's anything in the output chain buffers and ignores the fact that something may be buffered in low-level parts of the stack. Signed-off-by: Patryk Lesiewicz <patryk@google.com>
author Patryk Lesiewicz <patryk@google.com>
date Fri, 01 Dec 2017 15:59:14 -0800
parents 6a5a91de5b74
children 84e53e4735a4
comparison
equal deleted inserted replaced
7165:1cb92a2d672e 7166:a762ddf22dbb
3531 3531
3532 for ( ;; ) { 3532 for ( ;; ) {
3533 3533
3534 if (do_write) { 3534 if (do_write) {
3535 3535
3536 if (u->out_bufs || u->busy_bufs) { 3536 if (u->out_bufs || u->busy_bufs || downstream->buffered) {
3537 rc = ngx_http_output_filter(r, u->out_bufs); 3537 rc = ngx_http_output_filter(r, u->out_bufs);
3538 3538
3539 if (rc == NGX_ERROR) { 3539 if (rc == NGX_ERROR) {
3540 ngx_http_upstream_finalize_request(r, u, NGX_ERROR); 3540 ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
3541 return; 3541 return;