Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 2049:2a92804f4109
*) back out r2040
*) refactor ngx_palloc()
*) introduce ngx_pnalloc()
*) additional pool blocks have smaller header
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 17 Jun 2008 15:00:30 +0000 |
parents | 1d86674d1286 |
children | 5657037448d1 |
comparison
equal
deleted
inserted
replaced
2048:824615f3b4ec | 2049:2a92804f4109 |
---|---|
830 if (r->args.len == 0) { | 830 if (r->args.len == 0) { |
831 r->headers_out.location->value = clcf->name; | 831 r->headers_out.location->value = clcf->name; |
832 | 832 |
833 } else { | 833 } else { |
834 len = clcf->name.len + 1 + r->args.len; | 834 len = clcf->name.len + 1 + r->args.len; |
835 p = ngx_palloc(r->pool, len); | 835 p = ngx_pnalloc(r->pool, len); |
836 | 836 |
837 if (p == NULL) { | 837 if (p == NULL) { |
838 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | 838 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
839 return NGX_OK; | 839 return NGX_OK; |
840 } | 840 } |
1265 for (i = 0; i < r->exten.len; i++) { | 1265 for (i = 0; i < r->exten.len; i++) { |
1266 c = r->exten.data[i]; | 1266 c = r->exten.data[i]; |
1267 | 1267 |
1268 if (c >= 'A' && c <= 'Z') { | 1268 if (c >= 'A' && c <= 'Z') { |
1269 | 1269 |
1270 p = ngx_palloc(r->pool, r->exten.len); | 1270 p = ngx_pnalloc(r->pool, r->exten.len); |
1271 if (p == NULL) { | 1271 if (p == NULL) { |
1272 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 1272 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
1273 } | 1273 } |
1274 | 1274 |
1275 hash = 0; | 1275 hash = 0; |
1388 | 1388 |
1389 *root_length = clcf->root.len; | 1389 *root_length = clcf->root.len; |
1390 | 1390 |
1391 path->len = clcf->root.len + reserved; | 1391 path->len = clcf->root.len + reserved; |
1392 | 1392 |
1393 path->data = ngx_palloc(r->pool, path->len); | 1393 path->data = ngx_pnalloc(r->pool, path->len); |
1394 if (path->data == NULL) { | 1394 if (path->data == NULL) { |
1395 return NULL; | 1395 return NULL; |
1396 } | 1396 } |
1397 | 1397 |
1398 last = ngx_copy(path->data, clcf->root.data, clcf->root.len); | 1398 last = ngx_copy(path->data, clcf->root.data, clcf->root.len); |
1458 r->headers_in.user.data = (u_char *) ""; | 1458 r->headers_in.user.data = (u_char *) ""; |
1459 return NGX_DECLINED; | 1459 return NGX_DECLINED; |
1460 } | 1460 } |
1461 | 1461 |
1462 auth.len = ngx_base64_decoded_length(encoded.len); | 1462 auth.len = ngx_base64_decoded_length(encoded.len); |
1463 auth.data = ngx_palloc(r->pool, auth.len + 1); | 1463 auth.data = ngx_pnalloc(r->pool, auth.len + 1); |
1464 if (auth.data == NULL) { | 1464 if (auth.data == NULL) { |
1465 return NGX_ERROR; | 1465 return NGX_ERROR; |
1466 } | 1466 } |
1467 | 1467 |
1468 if (ngx_decode_base64(&auth, &encoded) != NGX_OK) { | 1468 if (ngx_decode_base64(&auth, &encoded) != NGX_OK) { |