Mercurial > hg > nginx
comparison src/http/ngx_http_script.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 | 782af1038115 |
children | 67a29af877ed |
comparison
equal
deleted
inserted
replaced
2048:824615f3b4ec | 2049:2a92804f4109 |
---|---|
339 len += lcode(&e); | 339 len += lcode(&e); |
340 } | 340 } |
341 | 341 |
342 | 342 |
343 value->len = len; | 343 value->len = len; |
344 value->data = ngx_palloc(r->pool, len); | 344 value->data = ngx_pnalloc(r->pool, len); |
345 if (value->data == NULL) { | 345 if (value->data == NULL) { |
346 return NULL; | 346 return NULL; |
347 } | 347 } |
348 | 348 |
349 e.ip = code_values; | 349 e.ip = code_values; |
731 | 731 |
732 if (code->add_args && r->args.len) { | 732 if (code->add_args && r->args.len) { |
733 e->buf.len += r->args.len + 1; | 733 e->buf.len += r->args.len + 1; |
734 } | 734 } |
735 | 735 |
736 e->buf.data = ngx_palloc(r->pool, e->buf.len); | 736 e->buf.data = ngx_pnalloc(r->pool, e->buf.len); |
737 if (e->buf.data == NULL) { | 737 if (e->buf.data == NULL) { |
738 e->ip = ngx_http_script_exit; | 738 e->ip = ngx_http_script_exit; |
739 e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; | 739 e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; |
740 return; | 740 return; |
741 } | 741 } |
1118 for (len = 0; *(uintptr_t *) le.ip; len += lcode(&le)) { | 1118 for (len = 0; *(uintptr_t *) le.ip; len += lcode(&le)) { |
1119 lcode = *(ngx_http_script_len_code_pt *) le.ip; | 1119 lcode = *(ngx_http_script_len_code_pt *) le.ip; |
1120 } | 1120 } |
1121 | 1121 |
1122 e->buf.len = len; | 1122 e->buf.len = len; |
1123 e->buf.data = ngx_palloc(e->request->pool, len); | 1123 e->buf.data = ngx_pnalloc(e->request->pool, len); |
1124 if (e->buf.data == NULL) { | 1124 if (e->buf.data == NULL) { |
1125 e->ip = ngx_http_script_exit; | 1125 e->ip = ngx_http_script_exit; |
1126 e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; | 1126 e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; |
1127 return; | 1127 return; |
1128 } | 1128 } |