comparison src/http/modules/ngx_http_fastcgi_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 f1cff424caeb
children 8c6521eedf84
comparison
equal deleted inserted replaced
2048:824615f3b4ec 2049:2a92804f4109
1057 1057
1058 for (i = 0; i < f->split_parts->nelts; i++) { 1058 for (i = 0; i < f->split_parts->nelts; i++) {
1059 size += part[i].end - part[i].start; 1059 size += part[i].end - part[i].start;
1060 } 1060 }
1061 1061
1062 p = ngx_palloc(r->pool, size); 1062 p = ngx_pnalloc(r->pool, size);
1063 if (p == NULL) { 1063 if (p == NULL) {
1064 return NGX_ERROR; 1064 return NGX_ERROR;
1065 } 1065 }
1066 1066
1067 buf.pos = p; 1067 buf.pos = p;
1085 1085
1086 h->value.len = r->header_end - r->header_start; 1086 h->value.len = r->header_end - r->header_start;
1087 h->value.data = r->header_start; 1087 h->value.data = r->header_start;
1088 h->value.data[h->value.len] = '\0'; 1088 h->value.data[h->value.len] = '\0';
1089 1089
1090 h->lowcase_key = ngx_palloc(r->pool, h->key.len); 1090 h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
1091 if (h->lowcase_key == NULL) { 1091 if (h->lowcase_key == NULL) {
1092 return NGX_ERROR; 1092 return NGX_ERROR;
1093 } 1093 }
1094 1094
1095 } else { 1095 } else {
1096 1096
1097 h->key.len = r->header_name_end - r->header_name_start; 1097 h->key.len = r->header_name_end - r->header_name_start;
1098 h->value.len = r->header_end - r->header_start; 1098 h->value.len = r->header_end - r->header_start;
1099 1099
1100 h->key.data = ngx_palloc(r->pool, 1100 h->key.data = ngx_pnalloc(r->pool,
1101 h->key.len + 1 + h->value.len + 1 1101 h->key.len + 1 + h->value.len + 1
1102 + h->key.len); 1102 + h->key.len);
1103 if (h->key.data == NULL) { 1103 if (h->key.data == NULL) {
1104 return NGX_ERROR; 1104 return NGX_ERROR;
1105 } 1105 }
1106 1106
1107 h->value.data = h->key.data + h->key.len + 1; 1107 h->value.data = h->key.data + h->key.len + 1;
2013 return NGX_OK; 2013 return NGX_OK;
2014 } 2014 }
2015 2015
2016 v->len = r->uri.len + flcf->index.len; 2016 v->len = r->uri.len + flcf->index.len;
2017 2017
2018 v->data = ngx_palloc(r->pool, v->len); 2018 v->data = ngx_pnalloc(r->pool, v->len);
2019 if (v->data == NULL) { 2019 if (v->data == NULL) {
2020 return NGX_ERROR; 2020 return NGX_ERROR;
2021 } 2021 }
2022 2022
2023 p = ngx_copy(v->data, r->uri.data, r->uri.len); 2023 p = ngx_copy(v->data, r->uri.data, r->uri.len);