2747 | 2747 |
if (u->busy_bufs == NULL) {
|
2748 | 2748 |
|
2749 | 2749 |
if (u->length == 0
|
2750 | |
|| upstream->read->eof
|
2751 | |
|| upstream->read->error)
|
|
2750 |
|| (upstream->read->eof && u->length == -1))
|
2752 | 2751 |
{
|
2753 | 2752 |
ngx_http_upstream_finalize_request(r, u, 0);
|
|
2753 |
return;
|
|
2754 |
}
|
|
2755 |
|
|
2756 |
if (upstream->read->eof) {
|
|
2757 |
ngx_log_error(NGX_LOG_ERR, upstream->log, 0,
|
|
2758 |
"upstream prematurely closed connection");
|
|
2759 |
|
|
2760 |
ngx_http_upstream_finalize_request(r, u,
|
|
2761 |
NGX_HTTP_BAD_GATEWAY);
|
|
2762 |
return;
|
|
2763 |
}
|
|
2764 |
|
|
2765 |
if (upstream->read->error) {
|
|
2766 |
ngx_http_upstream_finalize_request(r, u,
|
|
2767 |
NGX_HTTP_BAD_GATEWAY);
|
2754 | 2768 |
return;
|
2755 | 2769 |
}
|
2756 | 2770 |
|
|
3026 | 3040 |
if (p->upstream_done || p->upstream_eof || p->upstream_error) {
|
3027 | 3041 |
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
3028 | 3042 |
"http upstream exit: %p", p->out);
|
3029 | |
ngx_http_upstream_finalize_request(r, u, 0);
|
|
3043 |
|
|
3044 |
if (p->upstream_done
|
|
3045 |
|| (p->upstream_eof && p->length == -1))
|
|
3046 |
{
|
|
3047 |
ngx_http_upstream_finalize_request(r, u, 0);
|
|
3048 |
return;
|
|
3049 |
}
|
|
3050 |
|
|
3051 |
if (p->upstream_eof) {
|
|
3052 |
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
|
3053 |
"upstream prematurely closed connection");
|
|
3054 |
}
|
|
3055 |
|
|
3056 |
ngx_http_upstream_finalize_request(r, u, NGX_HTTP_BAD_GATEWAY);
|
3030 | 3057 |
return;
|
3031 | 3058 |
}
|
3032 | 3059 |
}
|