Mercurial > hg > nginx-vendor-0-7
annotate src/core/ngx_buf.c @ 506:b9fdcaf2062b NGINX_0_7_65
nginx 0.7.65
*) Security: now nginx/Windows ignores trailing spaces in URI.
Thanks to Dan Crowley, Core Security Technologies.
*) Security: now nginx/Windows ignores short files names.
Thanks to Dan Crowley, Core Security Technologies.
*) Change: now the "009" status code is written to an access log for
proxied HTTP/0.9 responses.
*) Change: now the default buffer size of the
"large_client_header_buffers" directive is 8K.
Thanks to Andrew Cholakian.
*) Change: now default SSL ciphers are "HIGH:!ADH:!MD5".
*) Change: now SSLv2 protocol is disabled by default.
*) Change: now $host variable value is always low case.
*) Feature: the conf/fastcgi.conf for simple FastCGI configurations.
*) Feature: now URI part is not required a "proxy_pass" directive if
variables are used.
*) Feature: the $ssl_session_id variable.
*) Bugfix: if a proxied or FastCGI request was internally redirected to
another proxied or FastCGI location, then $upstream_response_time
variable may have abnormally large value; the bug had appeared in
0.7.63.
*) Bugfix: if the "expires modified" set date in the past, then a
negative number was set in the "Cache-Control" response header
line.
Thanks to Alex Kapranoff.
*) Bugfix: nginx closed a connection if a cached response had an empty
body.
Thanks to Piotr Sikora.
*) Bugfix: nginx cached a 304 response if there was the "If-None-Match"
header line in a proxied request.
Thanks to Tim Dettrick and David Kostal.
*) Bugfix: nginx did not treat a comma as separator in the
"Cache-Control" backend response header line.
*) Bugfix: cached HTTP/0.9 responses were handled incorrectly.
*) Bugfix: nginx sent gzipped responses to clients those do not support
gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared
in 0.8.16.
*) Bugfix: nginx always added "Content-Encoding: gzip" response header
line in 304 responses sent by ngx_http_gzip_static_module.
*) Bugfix: the "!-x" operator did not work.
Thanks to Maxim Dounin.
*) Bugfix: a segmentation fault might occur in a worker process, if
limit_rate was used in HTTPS server.
Thanks to Maxim Dounin.
*) Bugfix: a segmentation fault might occur in a worker process while
$limit_rate logging.
Thanks to Maxim Dounin.
*) Bugfix: nginx did not support dates in 2038 year on 32-bit platforms;
*) Bugfix: nginx/Windows tried to delete a temporary file twice if the
file should replace an already existent file.
*) Bugfix: nginx/Windows tried to rename a temporary file twice if the
file should replace an already existent file.
*) Bugfix: nginx/Windows might not create temporary file, a cache file,
or "proxy/fastcgi_store"d file if a worker had no enough access
rights for top level directories.
*) Bugfix: in UTF-8 encoding support by "try_files" directive in
nginx/Windows.
*) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module.
Thanks to Maxim Dounin.
*) Bugfix: the ngx_http_autoindex_module did not show the trailing
slash in links to a directory; the bug had appeared in 0.7.15.
*) Bugfix: nginx did not close a log file set by the --error-log-path
configuration option; the bug had appeared in 0.7.53.
*) Bugfix: "addition_types" directive was incorrectly named
"addtion_types".
*) Bugfix: invalid request line in $request variable was written in
access_log only if error_log was set to "info" or "debug" level.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 01 Feb 2010 00:00:00 +0000 |
parents | fd759445d8a8 |
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 | |
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 | |
130 | 154 ngx_chain_t * |
155 ngx_chain_get_free_buf(ngx_pool_t *p, ngx_chain_t **free) | |
156 { | |
157 ngx_chain_t *cl; | |
158 | |
159 if (*free) { | |
160 cl = *free; | |
161 *free = cl->next; | |
162 cl->next = NULL; | |
163 return cl; | |
164 } | |
165 | |
166 cl = ngx_alloc_chain_link(p); | |
167 if (cl == NULL) { | |
168 return NULL; | |
169 } | |
170 | |
171 cl->buf = ngx_calloc_buf(p); | |
172 if (cl->buf == NULL) { | |
173 return NULL; | |
174 } | |
175 | |
176 cl->next = NULL; | |
177 | |
178 return cl; | |
179 } | |
180 | |
181 | |
48 | 182 void |
183 ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, | |
184 ngx_chain_t **out, ngx_buf_tag_t tag) | |
0 | 185 { |
48 | 186 ngx_chain_t *cl; |
0 | 187 |
188 if (*busy == NULL) { | |
189 *busy = *out; | |
190 | |
191 } else { | |
48 | 192 for (cl = *busy; cl->next; cl = cl->next) { /* void */ } |
4 | 193 |
48 | 194 cl->next = *out; |
0 | 195 } |
196 | |
197 *out = NULL; | |
198 | |
199 while (*busy) { | |
200 if (ngx_buf_size((*busy)->buf) != 0) { | |
201 break; | |
202 } | |
203 | |
204 if ((*busy)->buf->tag != tag) { | |
205 *busy = (*busy)->next; | |
206 continue; | |
207 } | |
208 | |
2 | 209 (*busy)->buf->pos = (*busy)->buf->start; |
210 (*busy)->buf->last = (*busy)->buf->start; | |
0 | 211 |
48 | 212 cl = *busy; |
213 *busy = cl->next; | |
214 cl->next = *free; | |
215 *free = cl; | |
0 | 216 } |
217 } |