Welcome! Log In Create A New Profile

Advanced

[PATCH] ngx_event_pipe: add judgment conditions for downstream errors.

Robinson Nie
July 30, 2018 09:34AM
Hello!

Here is a patch to solve the following problem: When the proxy is turned
on, if the downstream error (p->output_filter() returns an error), the
current code will still try to read upstream & write downstream, which is
actually unnecessary.


# HG changeset patch

# User dapeng.ndp<dapeng.ndp@alibaba-inc.com>

# Date 1532956361 -28800

# Mon Jul 30 21:12:41 2018 +0800

# Node ID cbacf180df090540846aefa4a4a5453e307be219

# Parent f7e79596baf209151682f2f7d220161c034657ac

ngx_event_pipe: add judgment conditions for downstream errors.


Avoid writing downstream & reading upstream, if there is an error due to
writing downstream.


diff -r f7e79596baf2 -r cbacf180df09 src/event/ngx_event_pipe.c

--- a/src/event/ngx_event_pipe.c Tue Jul 24 18:46:54 2018 +0300

+++ b/src/event/ngx_event_pipe.c Mon Jul 30 21:12:41 2018 +0800

@@ -247,6 +247,7 @@

} else if (!p->cacheable

&& p->downstream->data == p->output_ctx

&& p->downstream->write->ready

+ && !p->downstream_error

&& !p->downstream->write->delayed)

{

/*
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] ngx_event_pipe: add judgment conditions for downstream errors.

Robinson Nie 685 July 30, 2018 09:34AM

Re: [PATCH] ngx_event_pipe: add judgment conditions for downstream errors.

Maxim Dounin 228 July 30, 2018 01:22PM

Re: [PATCH] ngx_event_pipe: add judgment conditions for downstream errors.

Robinson Nie 184 July 30, 2018 11:38PM

Re: [PATCH] ngx_event_pipe: add judgment conditions for downstream errors.

Maxim Dounin 176 July 31, 2018 10:54AM

Re: [PATCH] ngx_event_pipe: add judgment conditions for downstream errors.

Robinson Nie 124 August 01, 2018 03:46AM

Re: [PATCH] ngx_event_pipe: add judgment conditions for downstream errors.

Maxim Dounin 184 August 01, 2018 09:22AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 158
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