Changeset feb0c3


Ignore:
Timestamp:
02/03/09 19:54:45 (3 years ago)
Author:
George Potapov <nephrite@…>
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)
Message:

vendor drop nginx 0.6.35

Location:
server
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • server/CHANGES

    r60af37 rfeb0c3  
     1 
     2Changes 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 
    112 
    213Changes 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 
    113 
    214éÚÍÅÎÅÎÉÑ × nginx 0.6.34                                          27.11.2008 
  • server/LICENSE

    rcef790 rfeb0c3  
    11/*  
    2  * Copyright (C) 2002-2008 Igor Sysoev 
     2 * Copyright (C) 2002-2009 Igor Sysoev 
    33 * 
    44 * Redistribution and use in source and binary forms, with or without 
     
    2222 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
    2323 * SUCH DAMAGE. 
    24  * 
    2524 */ 
  • server/src/core/nginx.h

    r60af37 rfeb0c3  
    99 
    1010 
    11 #define NGINX_VERSION      "0.6.34" 
     11#define NGINX_VERSION      "0.6.35" 
    1212#define NGINX_VER          "nginx/" NGINX_VERSION 
    1313 
  • server/src/core/ngx_slab.c

    r08686b rfeb0c3  
    662662 
    663663            page->slab = pages | NGX_SLAB_PAGE_START; 
    664  
    665 #if (NGX_DEBUG) 
    666664            page->next = NULL; 
    667665            page->prev = NGX_SLAB_PAGE; 
    668 #endif 
    669666 
    670667            if (--pages == 0) { 
     
    674671            for (p = page + 1; pages; pages--) { 
    675672                p->slab = NGX_SLAB_PAGE_BUSY; 
    676 #if (NGX_DEBUG) 
    677673                p->next = NULL; 
    678674                p->prev = NGX_SLAB_PAGE; 
    679 #endif 
    680675                p++; 
    681676            } 
  • server/src/core/ngx_string.c

    re5ee98 rfeb0c3  
    953953 
    954954/* 
    955  * ngx_utf_decode() decodes two and more bytes UTF sequences only 
     955 * ngx_utf8_decode() decodes two and more bytes UTF sequences only 
    956956 * the return values: 
    957957 *    0x80 - 0x10ffff         valid character 
    958  *    0x10ffff - 0xfffffffd   invalid sequence 
     958 *    0x110000 - 0xfffffffd   invalid sequence 
    959959 *    0xfffffffe              incomplete sequence 
    960960 *    0xffffffff              error 
     
    962962 
    963963uint32_t 
    964 ngx_utf_decode(u_char **p, size_t n) 
     964ngx_utf8_decode(u_char **p, size_t n) 
    965965{ 
    966966    size_t    len; 
     
    10191019 
    10201020size_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]; 
     1021ngx_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; 
    10301031 
    10311032        if (c < 0x80) { 
     1033            p++; 
    10321034            continue; 
    10331035        } 
    10341036 
    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        } 
    10461041    } 
    10471042 
     
    10511046 
    10521047u_char * 
    1053 ngx_utf_cpystrn(u_char *dst, u_char *src, size_t n) 
    1054 { 
    1055     u_char  c; 
     1048ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len) 
     1049{ 
     1050    u_char  c, *next; 
    10561051 
    10571052    if (n == 0) { 
     
    10591054    } 
    10601055 
    1061     for ( /* void */ ; --n; dst++, src++) { 
     1056    while (--n) { 
    10621057 
    10631058        c = *src; 
     
    10651060 
    10661061        if (c < 0x80) { 
    1067             if (*dst != '\0') { 
     1062 
     1063            if (c != '\0') { 
     1064                dst++; 
     1065                src++; 
     1066                len--; 
     1067 
    10681068                continue; 
    10691069            } 
     
    10721072        } 
    10731073 
    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        } 
    10831087    } 
    10841088 
  • server/src/core/ngx_string.h

    r6cd908 rfeb0c3  
    152152ngx_int_t ngx_decode_base64(ngx_str_t *dst, ngx_str_t *src); 
    153153 
    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_t n); 
     154uint32_t ngx_utf8_decode(u_char **p, size_t n); 
     155size_t ngx_utf8_length(u_char *p, size_t n); 
     156u_char *ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len); 
    157157 
    158158 
  • server/src/http/modules/ngx_http_autoindex_module.c

    rb57b1b rfeb0c3  
    136136    u_char                         *last, *filename, scale; 
    137137    off_t                           length; 
    138     size_t                          len, copy, allocated, root; 
     138    size_t                          len, utf_len, allocated, root; 
    139139    ngx_tm_t                        tm; 
    140140    ngx_err_t                       err; 
     
    330330 
    331331        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); 
    333333        } else { 
    334334            entry->utf_len = len; 
     
    413413        len = entry[i].utf_len; 
    414414 
    415         if (entry[i].name.len - len) { 
     415        if (entry[i].name.len != len) { 
    416416            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; 
    418418 
    419419            } else { 
    420                 copy = NGX_HTTP_AUTOINDEX_NAME_LEN + 1; 
     420                utf_len = NGX_HTTP_AUTOINDEX_NAME_LEN + 1; 
    421421            } 
    422422 
    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); 
    424425            last = b->last; 
    425426 
  • server/src/http/modules/ngx_http_charset_filter_module.c

    r60af37 rfeb0c3  
    643643 
    644644                saved = src; 
    645                 n = ngx_utf_decode(&saved, size); 
     645                n = ngx_utf8_decode(&saved, size); 
    646646 
    647647                if (n == 0xfffffffe) { 
     
    711711 
    712712    saved = ctx->saved; 
    713     n = ngx_utf_decode(&saved, i); 
     713    n = ngx_utf8_decode(&saved, i); 
    714714 
    715715    c = '\0'; 
     
    819819        len = buf->last - src; 
    820820 
    821         n = ngx_utf_decode(&src, len); 
     821        n = ngx_utf8_decode(&src, len); 
    822822 
    823823        if (n < 0x10000) { 
     
    12711271        p = &table->src2dst[src * NGX_UTF_LEN] + 1; 
    12721272 
    1273         n = ngx_utf_decode(&p, i); 
     1273        n = ngx_utf8_decode(&p, i); 
    12741274 
    12751275        if (n > 0xffff) { 
  • server/src/http/modules/perl/nginx.pm

    r60af37 rfeb0c3  
    4848); 
    4949 
    50 our $VERSION = '0.6.34'; 
     50our $VERSION = '0.6.35'; 
    5151 
    5252require XSLoader; 
  • server/src/http/ngx_http_core_module.c

    r60af37 rfeb0c3  
    3131static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r, 
    3232    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); 
    3433 
    3534static ngx_int_t ngx_http_core_preconfiguration(ngx_conf_t *cf); 
     
    787786    u_char                    *p; 
    788787    size_t                     len; 
    789     ngx_int_t                  rc, expect; 
     788    ngx_int_t                  rc; 
    790789    ngx_http_core_loc_conf_t  *clcf; 
    791790    ngx_http_core_srv_conf_t  *cscf; 
     
    834833    } 
    835834 
    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  
    845835    if (rc == NGX_HTTP_LOCATION_AUTO_REDIRECT) { 
    846836        r->headers_out.location = ngx_list_push(&r->headers_out.headers); 
     
    12621252 
    12631253 
    1264 static ngx_int_t 
    1265 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") - 1 
    1279         || 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  
    13031254ngx_int_t 
    13041255ngx_http_set_content_type(ngx_http_request_t *r) 
     
    18621813 
    18631814    sr->discard_body = r->discard_body; 
     1815    sr->expect_tested = 1; 
    18641816    sr->main_filter_need_in_memory = r->main_filter_need_in_memory; 
    18651817 
  • server/src/http/ngx_http_request_body.c

    rb57b1b rfeb0c3  
    1717static void ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r); 
    1818static ngx_int_t ngx_http_read_discarded_request_body(ngx_http_request_t *r); 
     19static ngx_int_t ngx_http_test_expect(ngx_http_request_t *r); 
    1920 
    2021 
     
    4142        post_handler(r); 
    4243        return NGX_OK; 
     44    } 
     45 
     46    if (ngx_http_test_expect(r) != NGX_OK) { 
     47        return NGX_HTTP_INTERNAL_SERVER_ERROR; 
    4348    } 
    4449 
     
    435440    } 
    436441 
     442    if (ngx_http_test_expect(r) != NGX_OK) { 
     443        return NGX_HTTP_INTERNAL_SERVER_ERROR; 
     444    } 
     445 
    437446    rev = r->connection->read; 
    438447 
     
    583592    return NGX_AGAIN; 
    584593} 
     594 
     595 
     596static ngx_int_t 
     597ngx_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  
    379379    } 
    380380 
     381    r->expect_tested = 1; 
     382 
    381383    if (ngx_http_discard_request_body(r) != NGX_OK) { 
    382384        error = NGX_HTTP_INTERNAL_SERVER_ERROR; 
     
    431433{ 
    432434    u_char                     ch, *p, *last; 
     435    ngx_int_t                  overwrite; 
    433436    ngx_str_t                 *uri, *args, u, a; 
    434437    ngx_table_elt_t           *location; 
    435438    ngx_http_core_loc_conf_t  *clcf; 
    436439 
    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; 
    438447 
    439448    r->zero_in_uri = 0; 
  • server/src/http/ngx_http_upstream.c

    r60af37 rfeb0c3  
    23462346                   "finalize http upstream request: %i", rc); 
    23472347 
    2348     *u->cleanup = NULL; 
     2348    if (u->cleanup) { 
     2349        *u->cleanup = NULL; 
     2350    } 
    23492351 
    23502352    if (u->state && u->state->response_sec) { 
  • server/src/os/unix/ngx_posix_init.c

    rb57b1b rfeb0c3  
    2323    ngx_readv_chain, 
    2424    ngx_udp_unix_recv, 
    25     NULL, 
     25    ngx_unix_send, 
    2626    ngx_writev_chain, 
    2727    0 
Note: See TracChangeset for help on using the changeset viewer.