Mercurial > hg > nginx
comparison src/http/modules/proxy/ngx_http_proxy_handler.c @ 152:fb48bf4fea1c
nginx-0.0.1-2003-10-21-11:47:21 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 21 Oct 2003 07:47:21 +0000 |
parents | 2d9e4a8b6d11 |
children | c71aeb75c071 |
comparison
equal
deleted
inserted
replaced
151:2d9e4a8b6d11 | 152:fb48bf4fea1c |
---|---|
740 ep->preread_hunks->hunk = p->header_in; | 740 ep->preread_hunks->hunk = p->header_in; |
741 ep->preread_hunks->next = NULL; | 741 ep->preread_hunks->next = NULL; |
742 | 742 |
743 ep->preread_size = p->header_in->last - p->header_in->pos; | 743 ep->preread_size = p->header_in->last - p->header_in->pos; |
744 | 744 |
745 /* | |
746 * event_proxy would do p->header_in->last += ep->preread_size | |
747 * as these bytes were read. | |
748 */ | |
749 p->header_in->last = p->header_in->pos; | |
750 | |
745 /* STUB */ ep->cachable = 0; | 751 /* STUB */ ep->cachable = 0; |
746 | 752 |
747 p->event_proxy = ep; | 753 p->event_proxy = ep; |
748 | 754 |
749 #if 0 | 755 #if 0 |
804 } else if (ep->upstream_eof) { | 810 } else if (ep->upstream_eof) { |
805 /* TODO: check length & update cache */ | 811 /* TODO: check length & update cache */ |
806 } | 812 } |
807 | 813 |
808 if (ep->upstream_done || ep->upstream_eof || ep->upstream_error) { | 814 if (ep->upstream_done || ep->upstream_eof || ep->upstream_error) { |
809 ngx_http_proxy_close_connection(c); | 815 ngx_http_proxy_close_connection(p->upstream.connection); |
810 p->upstream.connection = NULL; | 816 p->upstream.connection = NULL; |
811 } | 817 } |
812 } | 818 } |
813 | 819 |
814 if (ep->downstream_done) { | 820 if (ep->downstream_done) { |
817 return; | 823 return; |
818 } | 824 } |
819 | 825 |
820 if (ep->downstream_error) { | 826 if (ep->downstream_error) { |
821 if (!p->cachable && p->upstream.connection) { | 827 if (!p->cachable && p->upstream.connection) { |
822 ngx_http_proxy_close_connection(c); | 828 ngx_http_proxy_close_connection(p->upstream.connection); |
823 p->upstream.connection = NULL; | 829 p->upstream.connection = NULL; |
824 } | 830 } |
825 | 831 |
826 if (p->upstream.connection == NULL) { | 832 if (p->upstream.connection == NULL) { |
827 ngx_http_close_connection(c); | 833 ngx_http_close_connection(c); |
1050 if (p->upstream.connection) { | 1056 if (p->upstream.connection) { |
1051 ngx_http_proxy_close_connection(p->upstream.connection); | 1057 ngx_http_proxy_close_connection(p->upstream.connection); |
1052 p->upstream.connection = NULL; | 1058 p->upstream.connection = NULL; |
1053 } | 1059 } |
1054 | 1060 |
1055 if (p->header_sent) { | 1061 if (p->header_sent |
1062 && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE)) | |
1063 { | |
1056 rc = 0; | 1064 rc = 0; |
1057 } | 1065 } |
1058 | 1066 |
1059 ngx_http_finalize_request(p->request, rc); | 1067 ngx_http_finalize_request(p->request, rc); |
1060 | 1068 |
1150 conf->read_timeout = 30000; | 1158 conf->read_timeout = 30000; |
1151 | 1159 |
1152 conf->bufs.num = 10; | 1160 conf->bufs.num = 10; |
1153 conf->bufs.size = 4096; | 1161 conf->bufs.size = 4096; |
1154 conf->max_busy_len = 8192 + 4096; | 1162 conf->max_busy_len = 8192 + 4096; |
1163 | |
1164 | |
1165 /* CHECK in _init conf->max_temp_size >= conf->bufs.size !!! */ | |
1155 conf->max_temp_file_size = 4096 * 6; | 1166 conf->max_temp_file_size = 4096 * 6; |
1167 | |
1168 | |
1156 conf->temp_file_write_size = 4096 * 2; | 1169 conf->temp_file_write_size = 4096 * 2; |
1157 | 1170 |
1158 ngx_test_null(conf->temp_path, ngx_pcalloc(cf->pool, sizeof(ngx_path_t)), | 1171 ngx_test_null(conf->temp_path, ngx_pcalloc(cf->pool, sizeof(ngx_path_t)), |
1159 NULL); | 1172 NULL); |
1160 | 1173 |