comparison src/core/ngx_string.c @ 342:4276c2f1f434 NGINX_0_6_15

nginx 0.6.15 *) Feature: cygwin compatibility. Thanks to Vladimir Kutakov. *) Feature: the "merge_slashes" directive. *) Feature: the "gzip_vary" directive. *) Feature: the "server_tokens" directive. *) Bugfix: nginx did not unescape URI in the "include" SSI command. *) Bugfix: the segmentation fault was occurred on start or while reconfiguration if variable was used in the "charset" or "source_charset" directives. *) Bugfix: nginx returned the 400 response on requests like "GET http://www.domain.com HTTP/1.0". Thanks to James Oakley. *) Bugfix: if request with request body was redirected using the "error_page" directive, then nginx tried to read the request body again; bug appeared in 0.6.7. *) Bugfix: a segmentation fault occurred in worker process if no server_name was explicitly defined for server processing request; bug appeared in 0.6.7.
author Igor Sysoev <http://sysoev.ru>
date Mon, 22 Oct 2007 00:00:00 +0400
parents 10cc350ed8a1
children 05693816539c
comparison
equal deleted inserted replaced
341:183b4761fe5b 342:4276c2f1f434
1241 1241
1242 ch = *s++; 1242 ch = *s++;
1243 1243
1244 switch (state) { 1244 switch (state) {
1245 case sw_usual: 1245 case sw_usual:
1246 if (ch == '?' && type == NGX_UNESCAPE_URI) { 1246 if (ch == '?'
1247 && (type & (NGX_UNESCAPE_URI|NGX_UNESCAPE_REDIRECT)))
1248 {
1247 *d++ = ch; 1249 *d++ = ch;
1248 goto done; 1250 goto done;
1249 } 1251 }
1250 1252
1251 if (ch == '%') { 1253 if (ch == '%') {
1284 state = sw_usual; 1286 state = sw_usual;
1285 1287
1286 if (ch >= '0' && ch <= '9') { 1288 if (ch >= '0' && ch <= '9') {
1287 ch = (u_char) ((decoded << 4) + ch - '0'); 1289 ch = (u_char) ((decoded << 4) + ch - '0');
1288 1290
1289 if (type == NGX_UNESCAPE_URI) { 1291 if (type & NGX_UNESCAPE_REDIRECT) {
1290 if (ch > '%' && ch < 0x7f) { 1292 if (ch > '%' && ch < 0x7f) {
1291 *d++ = ch; 1293 *d++ = ch;
1292 break; 1294 break;
1293 } 1295 }
1294 1296
1304 1306
1305 c = (u_char) (ch | 0x20); 1307 c = (u_char) (ch | 0x20);
1306 if (c >= 'a' && c <= 'f') { 1308 if (c >= 'a' && c <= 'f') {
1307 ch = (u_char) ((decoded << 4) + c - 'a' + 10); 1309 ch = (u_char) ((decoded << 4) + c - 'a' + 10);
1308 1310
1309 if (type == NGX_UNESCAPE_URI) { 1311 if (type & NGX_UNESCAPE_URI) {
1312 if (ch == '?') {
1313 *d++ = ch;
1314 goto done;
1315 }
1316
1317 *d++ = ch;
1318 break;
1319 }
1320
1321 if (type & NGX_UNESCAPE_REDIRECT) {
1310 if (ch == '?') { 1322 if (ch == '?') {
1311 *d++ = ch; 1323 *d++ = ch;
1312 goto done; 1324 goto done;
1313 } 1325 }
1314 1326