Welcome! Log In Create A New Profile

Advanced

Re: ngx_http_upstream_process_non_buffered_request recv question

Maxim Dounin
July 14, 2016 09:02AM
Hello!

On Wed, Jul 13, 2016 at 11:09:47PM -0400, gaoyan09 wrote:

> 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?

The upstream->read->eof and upstream->read->error flags are
checked separately in the do_write code path, if there are no
buffers to send downstream.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

ngx_http_upstream_process_non_buffered_request recv question

gaoyan09 July 13, 2016 11:09PM

Re: ngx_http_upstream_process_non_buffered_request recv question

Maxim Dounin July 14, 2016 09:02AM

Re: ngx_http_upstream_process_non_buffered_request recv question

gaoyan09 July 14, 2016 09:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 167
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready