Mercurial > hg > nginx
comparison src/http/modules/ngx_http_proxy_module.c @ 4125:e5df04b05e75
Protocol version parsing in ngx_http_parse_status_line().
Once we know protocol version, set u->headers_in.connection_close to indicate
implicitly assumed connection close with HTTP before 1.1.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 15 Sep 2011 19:22:35 +0000 |
parents | 3183165283cc |
children | bba9a5ccc6cd |
comparison
equal
deleted
inserted
replaced
4124:0c30976f5bfa | 4125:e5df04b05e75 |
---|---|
1208 } | 1208 } |
1209 #endif | 1209 #endif |
1210 | 1210 |
1211 r->http_version = NGX_HTTP_VERSION_9; | 1211 r->http_version = NGX_HTTP_VERSION_9; |
1212 u->state->status = NGX_HTTP_OK; | 1212 u->state->status = NGX_HTTP_OK; |
1213 u->headers_in.connection_close = 1; | |
1213 | 1214 |
1214 return NGX_OK; | 1215 return NGX_OK; |
1215 } | 1216 } |
1216 | 1217 |
1217 if (u->state) { | 1218 if (u->state) { |
1231 ngx_memcpy(u->headers_in.status_line.data, ctx->status.start, len); | 1232 ngx_memcpy(u->headers_in.status_line.data, ctx->status.start, len); |
1232 | 1233 |
1233 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 1234 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
1234 "http proxy status %ui \"%V\"", | 1235 "http proxy status %ui \"%V\"", |
1235 u->headers_in.status_n, &u->headers_in.status_line); | 1236 u->headers_in.status_n, &u->headers_in.status_line); |
1237 | |
1238 if (ctx->status.http_version < NGX_HTTP_VERSION_11) { | |
1239 u->headers_in.connection_close = 1; | |
1240 } | |
1236 | 1241 |
1237 u->process_header = ngx_http_proxy_process_header; | 1242 u->process_header = ngx_http_proxy_process_header; |
1238 | 1243 |
1239 return ngx_http_proxy_process_header(r); | 1244 return ngx_http_proxy_process_header(r); |
1240 } | 1245 } |