Mercurial > hg > nginx-vendor-0-8
annotate src/core/ngx_buf.c @ 58:b55cbf18157e NGINX_0_1_29
nginx 0.1.29
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; bug appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 12 May 2005 00:00:00 +0400 |
parents | 3050baa54a26 |
children | 82d695e3d662 |
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 | |
48 | 11 ngx_buf_t * |
12 ngx_create_temp_buf(ngx_pool_t *pool, size_t size) | |
0 | 13 { |
14 ngx_buf_t *b; | |
15 | |
50 | 16 b = ngx_calloc_buf(pool); |
17 if (b == NULL) { | |
0 | 18 return NULL; |
19 } | |
20 | |
50 | 21 b->start = ngx_palloc(pool, size); |
22 if (b->start == NULL) { | |
0 | 23 return NULL; |
24 } | |
25 | |
48 | 26 /* |
27 * set by ngx_calloc_buf(): | |
28 * | |
29 * b->file_pos = 0; | |
30 * b->file_last = 0; | |
31 * b->file = NULL; | |
32 * b->shadow = NULL; | |
33 * b->tag = 0; | |
58 | 34 * and flags |
48 | 35 */ |
36 | |
0 | 37 b->pos = b->start; |
38 b->last = b->start; | |
39 b->end = b->last + size; | |
40 b->temporary = 1; | |
41 | |
42 return b; | |
43 } | |
44 | |
45 | |
48 | 46 ngx_chain_t * |
56 | 47 ngx_alloc_chain_link(ngx_pool_t *pool) |
48 { | |
49 ngx_chain_t *cl; | |
50 | |
51 cl = pool->chain; | |
52 | |
53 if (cl) { | |
54 pool->chain = cl->next; | |
55 return cl; | |
56 } | |
57 | |
58 cl = ngx_palloc(pool, sizeof(ngx_chain_t)); | |
59 if (cl == NULL) { | |
60 return NULL; | |
61 } | |
62 | |
63 return cl; | |
64 } | |
65 | |
66 | |
67 ngx_chain_t * | |
48 | 68 ngx_create_chain_of_bufs(ngx_pool_t *pool, ngx_bufs_t *bufs) |
0 | 69 { |
70 u_char *p; | |
71 ngx_int_t i; | |
72 ngx_buf_t *b; | |
73 ngx_chain_t *chain, *cl, **ll; | |
74 | |
50 | 75 p = ngx_palloc(pool, bufs->num * bufs->size); |
76 if (p == NULL) { | |
0 | 77 return NULL; |
78 } | |
79 | |
80 ll = &chain; | |
81 | |
82 for (i = 0; i < bufs->num; i++) { | |
50 | 83 |
84 b = ngx_calloc_buf(pool); | |
85 if (b == NULL) { | |
0 | 86 return NULL; |
87 } | |
88 | |
48 | 89 /* |
90 * set by ngx_calloc_buf(): | |
91 * | |
92 * b->file_pos = 0; | |
93 * b->file_last = 0; | |
94 * b->file = NULL; | |
95 * b->shadow = NULL; | |
96 * b->tag = 0; | |
58 | 97 * and flags |
48 | 98 * |
99 */ | |
100 | |
0 | 101 b->pos = p; |
102 b->last = p; | |
103 b->temporary = 1; | |
104 | |
105 b->start = p; | |
106 p += bufs->size; | |
107 b->end = p; | |
108 | |
50 | 109 cl = ngx_alloc_chain_link(pool); |
110 if (cl == NULL) { | |
0 | 111 return NULL; |
112 } | |
113 | |
114 cl->buf = b; | |
115 *ll = cl; | |
116 ll = &cl->next; | |
117 } | |
118 | |
119 *ll = NULL; | |
120 | |
121 return chain; | |
122 } | |
123 | |
124 | |
48 | 125 ngx_int_t |
126 ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain, ngx_chain_t *in) | |
0 | 127 { |
128 ngx_chain_t *cl, **ll; | |
129 | |
130 ll = chain; | |
131 | |
132 for (cl = *chain; cl; cl = cl->next) { | |
133 ll = &cl->next; | |
134 } | |
135 | |
136 while (in) { | |
50 | 137 cl = ngx_alloc_chain_link(pool); |
138 if (cl == NULL) { | |
139 return NGX_ERROR; | |
140 } | |
0 | 141 |
142 cl->buf = in->buf; | |
143 *ll = cl; | |
144 ll = &cl->next; | |
145 in = in->next; | |
146 } | |
147 | |
148 *ll = NULL; | |
149 | |
150 return NGX_OK; | |
151 } | |
152 | |
153 | |
48 | 154 void |
155 ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, | |
156 ngx_chain_t **out, ngx_buf_tag_t tag) | |
0 | 157 { |
48 | 158 ngx_chain_t *cl; |
0 | 159 |
160 if (*busy == NULL) { | |
161 *busy = *out; | |
162 | |
163 } else { | |
48 | 164 for (cl = *busy; cl->next; cl = cl->next) { /* void */ } |
4 | 165 |
48 | 166 cl->next = *out; |
0 | 167 } |
168 | |
169 *out = NULL; | |
170 | |
171 while (*busy) { | |
172 if (ngx_buf_size((*busy)->buf) != 0) { | |
173 break; | |
174 } | |
175 | |
18 | 176 #if (NGX_HAVE_WRITE_ZEROCOPY) |
0 | 177 if ((*busy)->buf->zerocopy_busy) { |
178 break; | |
179 } | |
180 #endif | |
181 | |
182 if ((*busy)->buf->tag != tag) { | |
183 *busy = (*busy)->next; | |
184 continue; | |
185 } | |
186 | |
2 | 187 (*busy)->buf->pos = (*busy)->buf->start; |
188 (*busy)->buf->last = (*busy)->buf->start; | |
0 | 189 |
48 | 190 cl = *busy; |
191 *busy = cl->next; | |
192 cl->next = *free; | |
193 *free = cl; | |
0 | 194 } |
195 } |