Changeset feb0c3
- Timestamp:
- 02/03/09 19:54:45 (3 years ago)
- Branches:
- master-v0.6, nginx-v0.6
- Children:
- 209e69, 6c857c, e8c363f79fad03918abb189d5a026fd0cd6d14f4
- Parents:
- 60af37
- git-author:
- George Potapov <nephrite@…> (02/03/09 19:54:45)
- git-committer:
- George Potapov <nephrite@…> (02/03/09 19:54:45)
- Location:
- server
- Files:
-
- 15 edited
-
CHANGES (modified) (1 diff)
-
CHANGES.ru (modified) (1 diff)
-
LICENSE (modified) (2 diffs)
-
src/core/nginx.h (modified) (1 diff)
-
src/core/ngx_slab.c (modified) (2 diffs)
-
src/core/ngx_string.c (modified) (7 diffs)
-
src/core/ngx_string.h (modified) (1 diff)
-
src/http/modules/ngx_http_autoindex_module.c (modified) (3 diffs)
-
src/http/modules/ngx_http_charset_filter_module.c (modified) (4 diffs)
-
src/http/modules/perl/nginx.pm (modified) (1 diff)
-
src/http/ngx_http_core_module.c (modified) (5 diffs)
-
src/http/ngx_http_request_body.c (modified) (4 diffs)
-
src/http/ngx_http_special_response.c (modified) (2 diffs)
-
src/http/ngx_http_upstream.c (modified) (1 diff)
-
src/os/unix/ngx_posix_init.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
server/CHANGES
r60af37 rfeb0c3 1 2 Changes with nginx 0.6.35 26 Jan 2009 3 4 *) Bugfix: in shared memory allocations if nginx was built without 5 debugging. 6 Thanks to Andrey Kvasov. 7 8 *) Bugfixes in an "Expect" request header line support. 9 10 *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module. 11 1 12 2 13 Changes with nginx 0.6.34 27 Nov 2008 -
server/CHANGES.ru
r60af37 rfeb0c3 1 2 éÚÍÅÎÅÎÉÑ × nginx 0.6.35 26.01.2009 3 4 *) éÓÐÒÁ×ÌÅÎÉÅ: ÏÛÉÂËÉ ×ÙÄÅÌÅÎÉÑ ÂÏÌØÛÉÈ ÂÌÏËÏ× × ÒÁÚÄÅÌÑÅÍÏÊ ÐÁÍÑÔÉ, 5 ÅÓÌÉ nginx ÂÙÌ ÓÏÂÒÁÎ ÂÅÚ ÏÔÌÁÄËÉ. 6 óÐÁÓÉÂÏ áÎÄÒÅÀ ë×ÁÓÏ×Õ. 7 8 *) éÓÐÒÁ×ÌÅÎÉÑ × ÐÏÄÄÅÒÖËÅ ÓÔÒÏËÉ "Expect" × ÚÁÇÏÌÏ×ËÅ ÚÁÐÒÏÓÁ. 9 10 *) éÓÐÒÁ×ÌÅÎÉÅ: ÏÛÉÂËÉ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ËÏÄÉÒÏ×ËÉ UTF-8 × 11 ngx_http_autoindex_module. 12 1 13 2 14 éÚÍÅÎÅÎÉÑ × nginx 0.6.34 27.11.2008 -
server/LICENSE
rcef790 rfeb0c3 1 1 /* 2 * Copyright (C) 2002-200 8Igor Sysoev2 * Copyright (C) 2002-2009 Igor Sysoev 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 22 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 23 * SUCH DAMAGE. 24 *25 24 */ -
server/src/core/nginx.h
r60af37 rfeb0c3 9 9 10 10 11 #define NGINX_VERSION "0.6.3 4"11 #define NGINX_VERSION "0.6.35" 12 12 #define NGINX_VER "nginx/" NGINX_VERSION 13 13 -
server/src/core/ngx_slab.c
r08686b rfeb0c3 662 662 663 663 page->slab = pages | NGX_SLAB_PAGE_START; 664 665 #if (NGX_DEBUG)666 664 page->next = NULL; 667 665 page->prev = NGX_SLAB_PAGE; 668 #endif669 666 670 667 if (--pages == 0) { … … 674 671 for (p = page + 1; pages; pages--) { 675 672 p->slab = NGX_SLAB_PAGE_BUSY; 676 #if (NGX_DEBUG)677 673 p->next = NULL; 678 674 p->prev = NGX_SLAB_PAGE; 679 #endif680 675 p++; 681 676 } -
server/src/core/ngx_string.c
re5ee98 rfeb0c3 953 953 954 954 /* 955 * ngx_utf _decode() decodes two and more bytes UTF sequences only955 * ngx_utf8_decode() decodes two and more bytes UTF sequences only 956 956 * the return values: 957 957 * 0x80 - 0x10ffff valid character 958 * 0x1 0ffff- 0xfffffffd invalid sequence958 * 0x110000 - 0xfffffffd invalid sequence 959 959 * 0xfffffffe incomplete sequence 960 960 * 0xffffffff error … … 962 962 963 963 uint32_t 964 ngx_utf _decode(u_char **p, size_t n)964 ngx_utf8_decode(u_char **p, size_t n) 965 965 { 966 966 size_t len; … … 1019 1019 1020 1020 size_t 1021 ngx_utf_length(u_char *p, size_t n) 1022 { 1023 u_char c; 1024 size_t len; 1025 ngx_uint_t i; 1026 1027 for (len = 0, i = 0; i < n; len++, i++) { 1028 1029 c = p[i]; 1021 ngx_utf8_length(u_char *p, size_t n) 1022 { 1023 u_char c, *last; 1024 size_t len; 1025 1026 last = p + n; 1027 1028 for (len = 0; p < last; len++) { 1029 1030 c = *p; 1030 1031 1031 1032 if (c < 0x80) { 1033 p++; 1032 1034 continue; 1033 1035 } 1034 1036 1035 if (c >= 0xc0) { 1036 for (c <<= 1; c & 0x80; c <<= 1) { 1037 i++; 1038 } 1039 1040 continue; 1041 } 1042 1043 /* invalid utf */ 1044 1045 return n; 1037 if (ngx_utf8_decode(&p, n) > 0x10ffff) { 1038 /* invalid UTF-8 */ 1039 return n; 1040 } 1046 1041 } 1047 1042 … … 1051 1046 1052 1047 u_char * 1053 ngx_utf _cpystrn(u_char *dst, u_char *src, size_tn)1054 { 1055 u_char c ;1048 ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len) 1049 { 1050 u_char c, *next; 1056 1051 1057 1052 if (n == 0) { … … 1059 1054 } 1060 1055 1061 for ( /* void */ ; --n; dst++, src++) {1056 while (--n) { 1062 1057 1063 1058 c = *src; … … 1065 1060 1066 1061 if (c < 0x80) { 1067 if (*dst != '\0') { 1062 1063 if (c != '\0') { 1064 dst++; 1065 src++; 1066 len--; 1067 1068 1068 continue; 1069 1069 } … … 1072 1072 } 1073 1073 1074 if (c >= 0xc0) { 1075 for (c <<= 1; c & 0x80; c <<= 1) { 1076 *++dst = *++src; 1077 } 1078 1079 continue; 1080 } 1081 1082 /* invalid utf */ 1074 next = src; 1075 1076 if (ngx_utf8_decode(&next, len) > 0x10ffff) { 1077 /* invalid UTF-8 */ 1078 break; 1079 } 1080 1081 len--; 1082 1083 while (src < next) { 1084 *++dst = *++src; 1085 len--; 1086 } 1083 1087 } 1084 1088 -
server/src/core/ngx_string.h
r6cd908 rfeb0c3 152 152 ngx_int_t ngx_decode_base64(ngx_str_t *dst, ngx_str_t *src); 153 153 154 uint32_t ngx_utf _decode(u_char **p, size_t n);155 size_t ngx_utf _length(u_char *p, size_t n);156 u_char *ngx_utf _cpystrn(u_char *dst, u_char *src, size_tn);154 uint32_t ngx_utf8_decode(u_char **p, size_t n); 155 size_t ngx_utf8_length(u_char *p, size_t n); 156 u_char *ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len); 157 157 158 158 -
server/src/http/modules/ngx_http_autoindex_module.c
rb57b1b rfeb0c3 136 136 u_char *last, *filename, scale; 137 137 off_t length; 138 size_t len, copy, allocated, root;138 size_t len, utf_len, allocated, root; 139 139 ngx_tm_t tm; 140 140 ngx_err_t err; … … 330 330 331 331 if (r->utf8) { 332 entry->utf_len = ngx_utf _length(entry->name.data, entry->name.len);332 entry->utf_len = ngx_utf8_length(entry->name.data, entry->name.len); 333 333 } else { 334 334 entry->utf_len = len; … … 413 413 len = entry[i].utf_len; 414 414 415 if (entry[i].name.len -len) {415 if (entry[i].name.len != len) { 416 416 if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) { 417 copy= NGX_HTTP_AUTOINDEX_NAME_LEN - 3 + 1;417 utf_len = NGX_HTTP_AUTOINDEX_NAME_LEN - 3 + 1; 418 418 419 419 } else { 420 copy= NGX_HTTP_AUTOINDEX_NAME_LEN + 1;420 utf_len = NGX_HTTP_AUTOINDEX_NAME_LEN + 1; 421 421 } 422 422 423 b->last = ngx_utf_cpystrn(b->last, entry[i].name.data, copy); 423 b->last = ngx_utf8_cpystrn(b->last, entry[i].name.data, 424 utf_len, entry[i].name.len + 1); 424 425 last = b->last; 425 426 -
server/src/http/modules/ngx_http_charset_filter_module.c
r60af37 rfeb0c3 643 643 644 644 saved = src; 645 n = ngx_utf _decode(&saved, size);645 n = ngx_utf8_decode(&saved, size); 646 646 647 647 if (n == 0xfffffffe) { … … 711 711 712 712 saved = ctx->saved; 713 n = ngx_utf _decode(&saved, i);713 n = ngx_utf8_decode(&saved, i); 714 714 715 715 c = '\0'; … … 819 819 len = buf->last - src; 820 820 821 n = ngx_utf _decode(&src, len);821 n = ngx_utf8_decode(&src, len); 822 822 823 823 if (n < 0x10000) { … … 1271 1271 p = &table->src2dst[src * NGX_UTF_LEN] + 1; 1272 1272 1273 n = ngx_utf _decode(&p, i);1273 n = ngx_utf8_decode(&p, i); 1274 1274 1275 1275 if (n > 0xffff) { -
server/src/http/modules/perl/nginx.pm
r60af37 rfeb0c3 48 48 ); 49 49 50 our $VERSION = '0.6.3 4';50 our $VERSION = '0.6.35'; 51 51 52 52 require XSLoader; -
server/src/http/ngx_http_core_module.c
r60af37 rfeb0c3 31 31 static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r, 32 32 ngx_array_t *locations, ngx_uint_t regex_start, size_t len); 33 static ngx_int_t ngx_http_core_send_continue(ngx_http_request_t *r);34 33 35 34 static ngx_int_t ngx_http_core_preconfiguration(ngx_conf_t *cf); … … 787 786 u_char *p; 788 787 size_t len; 789 ngx_int_t rc , expect;788 ngx_int_t rc; 790 789 ngx_http_core_loc_conf_t *clcf; 791 790 ngx_http_core_srv_conf_t *cscf; … … 834 833 } 835 834 836 if (r->headers_in.expect) {837 expect = ngx_http_core_send_continue(r);838 839 if (expect != NGX_OK) {840 ngx_http_finalize_request(r, expect);841 return NGX_OK;842 }843 }844 845 835 if (rc == NGX_HTTP_LOCATION_AUTO_REDIRECT) { 846 836 r->headers_out.location = ngx_list_push(&r->headers_out.headers); … … 1262 1252 1263 1253 1264 static ngx_int_t1265 ngx_http_core_send_continue(ngx_http_request_t *r)1266 {1267 ngx_int_t n;1268 ngx_str_t *expect;1269 1270 if (r->expect_tested) {1271 return NGX_OK;1272 }1273 1274 r->expect_tested = 1;1275 1276 expect = &r->headers_in.expect->value;1277 1278 if (expect->len != sizeof("100-continue") - 11279 || ngx_strncasecmp(expect->data, (u_char *) "100-continue",1280 sizeof("100-continue") - 1)1281 != 0)1282 {1283 return NGX_OK;1284 }1285 1286 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,1287 "send 100 Continue");1288 1289 n = r->connection->send(r->connection,1290 (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF,1291 sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1);1292 1293 if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) {1294 return NGX_OK;1295 }1296 1297 /* we assume that such small packet should be send successfully */1298 1299 return NGX_HTTP_INTERNAL_SERVER_ERROR;1300 }1301 1302 1303 1254 ngx_int_t 1304 1255 ngx_http_set_content_type(ngx_http_request_t *r) … … 1862 1813 1863 1814 sr->discard_body = r->discard_body; 1815 sr->expect_tested = 1; 1864 1816 sr->main_filter_need_in_memory = r->main_filter_need_in_memory; 1865 1817 -
server/src/http/ngx_http_request_body.c
rb57b1b rfeb0c3 17 17 static void ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r); 18 18 static ngx_int_t ngx_http_read_discarded_request_body(ngx_http_request_t *r); 19 static ngx_int_t ngx_http_test_expect(ngx_http_request_t *r); 19 20 20 21 … … 41 42 post_handler(r); 42 43 return NGX_OK; 44 } 45 46 if (ngx_http_test_expect(r) != NGX_OK) { 47 return NGX_HTTP_INTERNAL_SERVER_ERROR; 43 48 } 44 49 … … 435 440 } 436 441 442 if (ngx_http_test_expect(r) != NGX_OK) { 443 return NGX_HTTP_INTERNAL_SERVER_ERROR; 444 } 445 437 446 rev = r->connection->read; 438 447 … … 583 592 return NGX_AGAIN; 584 593 } 594 595 596 static ngx_int_t 597 ngx_http_test_expect(ngx_http_request_t *r) 598 { 599 ngx_int_t n; 600 ngx_str_t *expect; 601 602 if (r->expect_tested 603 || r->headers_in.expect == NULL 604 || r->http_version < NGX_HTTP_VERSION_11) 605 { 606 return NGX_OK; 607 } 608 609 r->expect_tested = 1; 610 611 expect = &r->headers_in.expect->value; 612 613 if (expect->len != sizeof("100-continue") - 1 614 || ngx_strncasecmp(expect->data, (u_char *) "100-continue", 615 sizeof("100-continue") - 1) 616 != 0) 617 { 618 return NGX_OK; 619 } 620 621 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 622 "send 100 Continue"); 623 624 n = r->connection->send(r->connection, 625 (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF, 626 sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1); 627 628 if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) { 629 return NGX_OK; 630 } 631 632 /* we assume that such small packet should be send successfully */ 633 634 return NGX_ERROR; 635 } -
server/src/http/ngx_http_special_response.c
r648814 rfeb0c3 379 379 } 380 380 381 r->expect_tested = 1; 382 381 383 if (ngx_http_discard_request_body(r) != NGX_OK) { 382 384 error = NGX_HTTP_INTERNAL_SERVER_ERROR; … … 431 433 { 432 434 u_char ch, *p, *last; 435 ngx_int_t overwrite; 433 436 ngx_str_t *uri, *args, u, a; 434 437 ngx_table_elt_t *location; 435 438 ngx_http_core_loc_conf_t *clcf; 436 439 437 r->err_status = err_page->overwrite; 440 overwrite = err_page->overwrite; 441 442 if (overwrite && overwrite != NGX_HTTP_OK) { 443 r->expect_tested = 1; 444 } 445 446 r->err_status = overwrite; 438 447 439 448 r->zero_in_uri = 0; -
server/src/http/ngx_http_upstream.c
r60af37 rfeb0c3 2346 2346 "finalize http upstream request: %i", rc); 2347 2347 2348 *u->cleanup = NULL; 2348 if (u->cleanup) { 2349 *u->cleanup = NULL; 2350 } 2349 2351 2350 2352 if (u->state && u->state->response_sec) { -
server/src/os/unix/ngx_posix_init.c
rb57b1b rfeb0c3 23 23 ngx_readv_chain, 24 24 ngx_udp_unix_recv, 25 NULL,25 ngx_unix_send, 26 26 ngx_writev_chain, 27 27 0
Note: See TracChangeset
for help on using the changeset viewer.
