ngx_http_upstream_process_non_buffered_request recv question

gaoyan09 nginx-forum at forum.nginx.org
Thu Jul 14 03:09:47 UTC 2016


size = b->end - b->last;

        if (size && upstream->read->ready) {

            n = upstream->recv(upstream, b->last, size);

            if (n == NGX_AGAIN) {
                break;
            }

            if (n > 0) {
                u->state->response_length += n;

                if (u->input_filter(u->input_filter_ctx, n) == NGX_ERROR) {
                    ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
                    return;
                }
            }

            do_write = 1;

            continue;
        }

Why not consider n==0 or n==NGX_ERROR as ngx_http_upstream_process_upgraded
How handle it if upstream connection failed?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,268278,268278#msg-268278



More information about the nginx mailing list