comparison src/core/ngx_buf.c @ 50:72eb30262aac NGINX_0_1_25

nginx 0.1.25 *) Bugfix: nginx did run on Linux parisc. *) Feature: nginx now does not start under FreeBSD if the sysctl kern.ipc.somaxconn value is too big. *) Bugfix: if a request was internally redirected by the ngx_http_index_module module to the ngx_http_proxy_module or ngx_http_fastcgi_module modules, then the index file was not closed after request completion. *) Feature: the "proxy_pass" can be used in location with regular expression. *) Feature: the ngx_http_rewrite_filter_module module supports the condition like "if ($HTTP_USER_AGENT ~ MSIE)". *) Bugfix: nginx started too slow if the large number of addresses and text values were used in the "geo" directive. *) Change: a variable name must be declared as "$name" in the "geo" directive. The previous variant without "$" is still supported, but will be removed soon. *) Feature: the "%{VARIABLE}v" logging parameter. *) Feature: the "set $name value" directive. *) Bugfix: gcc 4.0 compatibility. *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
author Igor Sysoev <http://sysoev.ru>
date Sat, 19 Mar 2005 00:00:00 +0300
parents 6cfc63e68377
children 3050baa54a26
comparison
equal deleted inserted replaced
49:93dabbc9efb9 50:72eb30262aac
11 ngx_buf_t * 11 ngx_buf_t *
12 ngx_create_temp_buf(ngx_pool_t *pool, size_t size) 12 ngx_create_temp_buf(ngx_pool_t *pool, size_t size)
13 { 13 {
14 ngx_buf_t *b; 14 ngx_buf_t *b;
15 15
16 if (!(b = ngx_calloc_buf(pool))) { 16 b = ngx_calloc_buf(pool);
17 if (b == NULL) {
17 return NULL; 18 return NULL;
18 } 19 }
19 20
20 if (!(b->start = ngx_palloc(pool, size))) { 21 b->start = ngx_palloc(pool, size);
22 if (b->start == NULL) {
21 return NULL; 23 return NULL;
22 } 24 }
23 25
24 /* 26 /*
25 * set by ngx_calloc_buf(): 27 * set by ngx_calloc_buf():
47 u_char *p; 49 u_char *p;
48 ngx_int_t i; 50 ngx_int_t i;
49 ngx_buf_t *b; 51 ngx_buf_t *b;
50 ngx_chain_t *chain, *cl, **ll; 52 ngx_chain_t *chain, *cl, **ll;
51 53
52 if (!(p = ngx_palloc(pool, bufs->num * bufs->size))) { 54 p = ngx_palloc(pool, bufs->num * bufs->size);
55 if (p == NULL) {
53 return NULL; 56 return NULL;
54 } 57 }
55 58
56 ll = &chain; 59 ll = &chain;
57 60
58 for (i = 0; i < bufs->num; i++) { 61 for (i = 0; i < bufs->num; i++) {
59 if (!(b = ngx_calloc_buf(pool))) { 62
63 b = ngx_calloc_buf(pool);
64 if (b == NULL) {
60 return NULL; 65 return NULL;
61 } 66 }
62 67
63 /* 68 /*
64 * set by ngx_calloc_buf(): 69 * set by ngx_calloc_buf():
77 82
78 b->start = p; 83 b->start = p;
79 p += bufs->size; 84 p += bufs->size;
80 b->end = p; 85 b->end = p;
81 86
82 if (!(cl = ngx_alloc_chain_link(pool))) { 87 cl = ngx_alloc_chain_link(pool);
88 if (cl == NULL) {
83 return NULL; 89 return NULL;
84 } 90 }
85 91
86 cl->buf = b; 92 cl->buf = b;
87 *ll = cl; 93 *ll = cl;
104 for (cl = *chain; cl; cl = cl->next) { 110 for (cl = *chain; cl; cl = cl->next) {
105 ll = &cl->next; 111 ll = &cl->next;
106 } 112 }
107 113
108 while (in) { 114 while (in) {
109 ngx_test_null(cl, ngx_alloc_chain_link(pool), NGX_ERROR); 115 cl = ngx_alloc_chain_link(pool);
116 if (cl == NULL) {
117 return NGX_ERROR;
118 }
110 119
111 cl->buf = in->buf; 120 cl->buf = in->buf;
112 *ll = cl; 121 *ll = cl;
113 ll = &cl->next; 122 ll = &cl->next;
114 in = in->next; 123 in = in->next;