Mercurial > hg > nginx-vendor-0-7
annotate src/core/ngx_list.c @ 366:babd3d9efb62 NGINX_0_6_27
nginx 0.6.27
*) Change: now by default the rtsig method is not built on
Linux 2.6.18+.
*) Change: now a request method is not changed while redirection to a
named location via an "error_page" directive.
*) Feature: the "resolver" and "resolver_timeout" directives in SMTP
proxy.
*) Feature: the "post_action" directive supports named locations.
*) Bugfix: a segmentation fault occurred in worker process, if a
request was redirected from proxy, FastCGI, or memcached location to
static named locations.
*) Bugfix: browsers did not repeat SSL handshake if there is no valid
client certificate in first handshake.
Thanks to Alexander V. Inyukhin.
*) Bugfix: if response code 495-497 was redirected via an "error_page"
directive without code change, then nginx tried to allocate too many
memory.
*) Bugfix: memory leak in long-lived non buffered connections.
*) Bugfix: memory leak in resolver.
*) Bugfix: a segmentation fault occurred in worker process, if a
request was redirected from proxy, FastCGI, or memcached location to
static named locations.
*) Bugfix: in the $proxy_host and $proxy_port variables caching.
Thanks to Sergey Bochenkov.
*) Bugfix: a "proxy_pass" directive with variables used incorrectly the
same port as in another "proxy_pass" directive with the same host
name and without variables.
Thanks to Sergey Bochenkov.
*) Bugfix: an alert "sendmsg() failed (9: Bad file descriptor)" on some
64-bit platforms while reconfiguration.
*) Bugfix: a segmentation fault occurred in worker process, if empty
stub block was used second time in SSI.
*) Bugfix: in copying URI part contained escaped symbols into arguments.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 12 Mar 2008 00:00:00 +0300 |
parents | b52bd034c577 |
children |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 | |
10 | |
246 | 11 ngx_list_t * |
12 ngx_list_create(ngx_pool_t *pool, ngx_uint_t n, size_t size) | |
13 { | |
14 ngx_list_t *list; | |
15 | |
16 list = ngx_palloc(pool, sizeof(ngx_list_t)); | |
17 if (list == NULL) { | |
18 return NULL; | |
19 } | |
20 | |
21 list->part.elts = ngx_palloc(pool, n * size); | |
22 if (list->part.elts == NULL) { | |
23 return NULL; | |
24 } | |
25 | |
26 list->part.nelts = 0; | |
27 list->part.next = NULL; | |
28 list->last = &list->part; | |
29 list->size = size; | |
30 list->nalloc = n; | |
31 list->pool = pool; | |
32 | |
33 return list; | |
34 } | |
35 | |
36 | |
37 void * | |
38 ngx_list_push(ngx_list_t *l) | |
0 | 39 { |
40 void *elt; | |
41 ngx_list_part_t *last; | |
42 | |
43 last = l->last; | |
44 | |
45 if (last->nelts == l->nalloc) { | |
46 | |
47 /* the last part is full, allocate a new list part */ | |
48 | |
50 | 49 last = ngx_palloc(l->pool, sizeof(ngx_list_part_t)); |
50 if (last == NULL) { | |
0 | 51 return NULL; |
52 } | |
53 | |
50 | 54 last->elts = ngx_palloc(l->pool, l->nalloc * l->size); |
55 if (last->elts == NULL) { | |
0 | 56 return NULL; |
57 } | |
58 | |
59 last->nelts = 0; | |
60 last->next = NULL; | |
61 | |
62 l->last->next = last; | |
63 l->last = last; | |
64 } | |
65 | |
66 elt = (char *) last->elts + l->size * last->nelts; | |
67 last->nelts++; | |
68 | |
69 return elt; | |
70 } |