diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-05-10 19:53:35 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-05-10 19:53:35 +0000 |
commit | 11688f8a53743e41e807aae1179a6d552d87372e (patch) | |
tree | 736c3ea779a813391ba0acf21e2e2cd08546b8d9 /src | |
parent | 5aeeb2dc4687c38386f2440a56f29758a53b5551 (diff) | |
download | nginx-11688f8a53743e41e807aae1179a6d552d87372e.tar.gz nginx-11688f8a53743e41e807aae1179a6d552d87372e.zip |
nginx-0.0.3-2004-05-10-23:53:35 import
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/proxy/ngx_http_proxy_handler.c | 5 | ||||
-rw-r--r-- | src/http/ngx_http_write_filter.c | 15 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c index 027dc3ccc..8aa339772 100644 --- a/src/http/modules/proxy/ngx_http_proxy_handler.c +++ b/src/http/modules/proxy/ngx_http_proxy_handler.c @@ -1202,6 +1202,11 @@ static char *ngx_http_proxy_parse_upstream(ngx_str_t *url, if (u->port_text.len > 0) { u->port = ngx_atoi(u->port_text.data, u->port_text.len); if (u->port > 0) { + + if (u->port == 80) { + u->default_port = 1; + } + u->port = htons((u_short) u->port); return NULL; } diff --git a/src/http/ngx_http_write_filter.c b/src/http/ngx_http_write_filter.c index 8c1a98a91..05675374d 100644 --- a/src/http/ngx_http_write_filter.c +++ b/src/http/ngx_http_write_filter.c @@ -70,7 +70,7 @@ int ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) { int last; off_t size, flush; - ngx_chain_t *cl, **ll, *chain; + ngx_chain_t *cl, *ln, **ll, *chain; ngx_http_write_filter_ctx_t *ctx; ngx_http_write_filter_conf_t *conf; @@ -105,8 +105,8 @@ int ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) /* add the new chain to the existent one */ - for (/* void */; in; in = in->next) { - ngx_alloc_link_and_set_hunk(cl, in->hunk, r->pool, NGX_ERROR); + for (ln = in; ln; ln = ln->next) { + ngx_alloc_link_and_set_hunk(cl, ln->hunk, r->pool, NGX_ERROR); *ll = cl; ll = &cl->next; @@ -129,11 +129,12 @@ int ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) ngx_http_write_filter_module); /* - * avoid the output if there is no last hunk, no flush point and - * the size of the hunks is smaller than "postpone_output" directive + * avoid the output if there is no last hunk, no flush point, + * there are the incoming hunks and the size of all hunks + * is smaller than "postpone_output" directive */ - if (!last && flush == 0 && size < (off_t) conf->postpone_output) { + if (!last && flush == 0 && in && size < (off_t) conf->postpone_output) { return NGX_OK; } @@ -142,6 +143,8 @@ int ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) } if (size == 0) { + ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, + "the http output chain is empty"); return NGX_OK; } |