comparison src/core/ngx_output_chain.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
153 153
154 size = (size_t) bsize; 154 size = (size_t) bsize;
155 } 155 }
156 } 156 }
157 157
158 if (!(ctx->buf = ngx_create_temp_buf(ctx->pool, size))) { 158 ctx->buf = ngx_create_temp_buf(ctx->pool, size);
159 if (ctx->buf == NULL) {
159 return NGX_ERROR; 160 return NGX_ERROR;
160 } 161 }
161 162
162 ctx->buf->tag = ctx->tag; 163 ctx->buf->tag = ctx->tag;
163 ctx->buf->recycled = 1; 164 ctx->buf->recycled = 1;
184 185
185 if (ngx_buf_size(ctx->in->buf) == 0) { 186 if (ngx_buf_size(ctx->in->buf) == 0) {
186 ctx->in = ctx->in->next; 187 ctx->in = ctx->in->next;
187 } 188 }
188 189
189 if (!(cl = ngx_alloc_chain_link(ctx->pool))) { 190 cl = ngx_alloc_chain_link(ctx->pool);
191 if (cl == NULL) {
190 return NGX_ERROR; 192 return NGX_ERROR;
191 } 193 }
194
192 cl->buf = ctx->buf; 195 cl->buf = ctx->buf;
193 cl->next = NULL; 196 cl->next = NULL;
194 *last_out = cl; 197 *last_out = cl;
195 last_out = &cl->next; 198 last_out = &cl->next;
196 ctx->buf = NULL; 199 ctx->buf = NULL;
267 ll = &cl->next; 270 ll = &cl->next;
268 } 271 }
269 272
270 while (in) { 273 while (in) {
271 274
272 if (!(cl = ngx_alloc_chain_link(pool))) { 275 cl = ngx_alloc_chain_link(pool);
276 if (cl == NULL) {
273 return NGX_ERROR; 277 return NGX_ERROR;
274 } 278 }
275 279
276 #if (NGX_SENDFILE_LIMIT) 280 #if (NGX_SENDFILE_LIMIT)
277 281
279 283
280 if (buf->in_file 284 if (buf->in_file
281 && buf->file_pos < NGX_SENDFILE_LIMIT 285 && buf->file_pos < NGX_SENDFILE_LIMIT
282 && buf->file_last > NGX_SENDFILE_LIMIT) 286 && buf->file_last > NGX_SENDFILE_LIMIT)
283 { 287 {
284 if (!(b = ngx_calloc_buf(pool))) { 288 b = ngx_calloc_buf(pool);
289 if (b == NULL) {
285 return NGX_ERROR; 290 return NGX_ERROR;
286 } 291 }
287 292
288 ngx_memcpy(b, buf, sizeof(ngx_buf_t)); 293 ngx_memcpy(b, buf, sizeof(ngx_buf_t));
289 294
429 size += ngx_buf_size(in->buf); 434 size += ngx_buf_size(in->buf);
430 435
431 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->connection->log, 0, 436 ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->connection->log, 0,
432 "chain writer buf size: %uz", ngx_buf_size(in->buf)); 437 "chain writer buf size: %uz", ngx_buf_size(in->buf));
433 438
434 if (!(cl = ngx_alloc_chain_link(ctx->pool))) { 439 cl = ngx_alloc_chain_link(ctx->pool);
440 if (cl == NULL) {
435 return NGX_ERROR; 441 return NGX_ERROR;
436 } 442 }
443
437 cl->buf = in->buf; 444 cl->buf = in->buf;
438 cl->next = NULL; 445 cl->next = NULL;
439 *ctx->last = cl; 446 *ctx->last = cl;
440 ctx->last = &cl->next; 447 ctx->last = &cl->next;
441 } 448 }