Mercurial > hg > nginx
comparison src/http/modules/ngx_http_proxy_module.c @ 3628:cf47471a9eda
make code more obviuos
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 15 Jun 2010 15:21:37 +0000 |
parents | 9061fdb2ed8c |
children | a2a3378824ba |
comparison
equal
deleted
inserted
replaced
3627:9061fdb2ed8c | 3628:cf47471a9eda |
---|---|
1186 | 1186 |
1187 | 1187 |
1188 static ngx_int_t | 1188 static ngx_int_t |
1189 ngx_http_proxy_process_status_line(ngx_http_request_t *r) | 1189 ngx_http_proxy_process_status_line(ngx_http_request_t *r) |
1190 { | 1190 { |
1191 size_t len; | |
1191 ngx_int_t rc; | 1192 ngx_int_t rc; |
1192 ngx_http_upstream_t *u; | 1193 ngx_http_upstream_t *u; |
1193 ngx_http_proxy_ctx_t *ctx; | 1194 ngx_http_proxy_ctx_t *ctx; |
1194 | 1195 |
1195 ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module); | 1196 ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module); |
1236 u->state->status = ctx->status.code; | 1237 u->state->status = ctx->status.code; |
1237 } | 1238 } |
1238 | 1239 |
1239 u->headers_in.status_n = ctx->status.code; | 1240 u->headers_in.status_n = ctx->status.code; |
1240 | 1241 |
1241 u->headers_in.status_line.len = ctx->status.end - ctx->status.start; | 1242 len = ctx->status.end - ctx->status.start; |
1242 u->headers_in.status_line.data = ngx_pnalloc(r->pool, | 1243 u->headers_in.status_line.len = len; |
1243 u->headers_in.status_line.len); | 1244 |
1245 u->headers_in.status_line.data = ngx_pnalloc(r->pool, len); | |
1244 if (u->headers_in.status_line.data == NULL) { | 1246 if (u->headers_in.status_line.data == NULL) { |
1245 return NGX_ERROR; | 1247 return NGX_ERROR; |
1246 } | 1248 } |
1247 | 1249 |
1248 ngx_memcpy(u->headers_in.status_line.data, ctx->status.start, | 1250 ngx_memcpy(u->headers_in.status_line.data, ctx->status.start, len); |
1249 u->headers_in.status_line.len); | |
1250 | 1251 |
1251 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 1252 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
1252 "http proxy status %ui \"%V\"", | 1253 "http proxy status %ui \"%V\"", |
1253 u->headers_in.status_n, &u->headers_in.status_line); | 1254 u->headers_in.status_n, &u->headers_in.status_line); |
1254 | 1255 |