{
u_char *prev;
size_t bsize;
+ ngx_int_t rc;
ngx_uint_t flush, prev_last_shadow;
ngx_chain_t *out, **ll, *cl;
ngx_connection_t *downstream;
cl->buf->recycled = 0;
}
- if (p->output_filter(p->output_ctx, p->out) == NGX_ERROR) {
+ rc = p->output_filter(p->output_ctx, p->out);
+
+ if (downstream->destroyed) {
+ return NGX_ABORT;
+ }
+
+ if (rc == NGX_ERROR) {
p->downstream_error = 1;
return ngx_event_pipe_drain_chains(p);
}
cl->buf->recycled = 0;
}
- if (p->output_filter(p->output_ctx, p->in) == NGX_ERROR) {
+ rc = p->output_filter(p->output_ctx, p->in);
- if (downstream->destroyed) {
- return NGX_ABORT;
- }
+ if (downstream->destroyed) {
+ return NGX_ABORT;
+ }
+ if (rc == NGX_ERROR) {
p->downstream_error = 1;
return ngx_event_pipe_drain_chains(p);
}
break;
}
- if (p->output_filter(p->output_ctx, out) == NGX_ERROR) {
+ rc = p->output_filter(p->output_ctx, out);
+
+ if (downstream->destroyed) {
+ return NGX_ABORT;
+ }
+
+ if (rc == NGX_ERROR) {
p->downstream_error = 1;
return ngx_event_pipe_drain_chains(p);
}