Changeset 60fc2a


Ignore:
Timestamp:
04/24/09 12:45:13 (3 years ago)
Author:
George Potapov <nephrite@…>
Branches:
master-v0.7, nginx-v0.7, nginx-v0.8
Children:
65d620
Parents:
c1871c
git-author:
George Potapov <nephrite@…> (04/24/09 12:45:13)
git-committer:
George Potapov <nephrite@…> (04/24/09 12:45:13)
Message:

Vendor drop nginx v0.7.51

Location:
server
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • server/CHANGES

    rc1871c r60fc2a  
     1 
     2Changes with nginx 0.7.51                                        12 Apr 2009 
     3 
     4    *) Feature: the "try_files" directive supports a response code in the  
     5       fallback parameter. 
     6 
     7    *) Feature: now any response code can be used in the "return" directive. 
     8 
     9    *) Bugfix: the "error_page" directive made an external redirect without  
     10       query string; the bug had appeared in 0.7.44. 
     11 
     12    *) Bugfix: if servers listened on several defined explicitly addresses,  
     13       then virtual servers might not work; the bug had appeared in 0.7.39. 
     14 
    115 
    216Changes with nginx 0.7.50                                        06 Apr 2009 
    317 
    4     *) Change: a segmentation fault might occur in worker process, if the  
    5        $arg_... variables were used; the bug had appeared in 0.7.48. 
     18    *) Bugfix: the $arg_... variables did not work; the bug had appeared in  
     19       0.7.49. 
    620 
    721 
    822Changes with nginx 0.7.49                                        06 Apr 2009 
    923 
    10     *) Change: a segmentation fault might occur in worker process, if the  
     24    *) Bugfix: a segmentation fault might occur in worker process, if the  
    1125       $arg_... variables were used; the bug had appeared in 0.7.48. 
    1226 
     
    214228 
    215229    *) Bugfix: "*domain.tld" names were handled incorrectly in  
    216        "server_name", "valid_referers", and "map" directives, if an  
     230       "server_name", "valid_referers", and "map" directives, if  
    217231       ".domain.tld" and ".subdomain.domain.tld" wildcards were used;  
    218232       the bug had appeared in 0.7.9. 
  • server/CHANGES.ru

    rc1871c r60fc2a  
     1 
     2éÚÍÅÎÅÎÉÑ × nginx 0.7.51                                          12.04.2009 
     3 
     4    *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Á try_files ÐÏÄÄÅÒÖÉ×ÁÅÔ ËÏÄ ÏÔ×ÅÔÁ × ÐÏÓÌÅÄÎÅÍ  
     5       ÐÁÒÁÍÅÔÒÅ. 
     6 
     7    *) äÏÂÁ×ÌÅÎÉÅ: ÔÅÐÅÒØ × ÄÉÒÅËÔÉ×Å return ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÌÀÂÏÊ ËÏÄ  
     8       ÏÔ×ÅÔÁ. 
     9 
     10    *) éÓÐÒÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Á error_page ÄÅÌÁÌÁ ×ÎÅÛÎÉÊ ÒÅÄÉÒÅËÔ ÂÅÚ ÓÔÒÏËÉ  
     11       ÚÁÐÒÏÓÁ; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.44. 
     12 
     13    *) éÓÐÒÁ×ÌÅÎÉÅ: ÅÓÌÉ ÓÅÒ×ÅÒÁ ÓÌÕÛÁÌÉ ÎÁ ÎÅÓËÏÌØËÉÈ Ñ×ÎÏ ÏÐÉÓÁÎÎÙÈ  
     14       ÁÄÒÅÓÁÈ, ÔÏ ×ÉÒÔÕÁÌØÎÙÅ ÓÅÒ×ÅÒÁ ÍÏÇÌÉ ÎÅ ÒÁÂÏÔÁÔØ; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ  
     15       × 0.7.39. 
     16 
    117 
    218éÚÍÅÎÅÎÉÑ × nginx 0.7.50                                          06.04.2009 
    319 
    4     *) éÚÍÅÎÅÎÉÅ: ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÐÅÒÅÍÅÎÎÙÈ $arg_... × ÒÁÂÏÞÅÍ ÐÒÏÃÅÓÓÅ  
    5        ÍÏÇ ÐÒÏÉÚÏÊÔÉ segmentation fault; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.48. 
     20    *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÅÒÅÍÅÎÎÙÅ $arg_... ÎÅ ÒÁÂÏÔÁÌÉ; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ ×  
     21       0.7.49. 
    622 
    723 
    824éÚÍÅÎÅÎÉÑ × nginx 0.7.49                                          06.04.2009 
    925 
    10     *) éÚÍÅÎÅÎÉÅ: ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÐÅÒÅÍÅÎÎÙÈ $arg_... × ÒÁÂÏÞÅÍ ÐÒÏÃÅÓÓÅ  
    11        ÍÏÇ ÐÒÏÉÚÏÊÔÉ segmentation fault; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.48. 
     26    *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÐÅÒÅÍÅÎÎÙÈ $arg_... × ÒÁÂÏÞÅÍ  
     27       ÐÒÏÃÅÓÓÅ ÍÏÇ ÐÒÏÉÚÏÊÔÉ segmentation fault; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.48. 
    1228 
    1329 
  • server/conf/nginx.conf

    rd5a395 r60fc2a  
    2020 
    2121    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' 
    22     #                  '"$status" $body_bytes_sent "$http_referer" ' 
     22    #                  '$status $body_bytes_sent "$http_referer" ' 
    2323    #                  '"$http_user_agent" "$http_x_forwarded_for"'; 
    2424 
  • server/src/core/nginx.h

    rc1871c r60fc2a  
    99 
    1010 
    11 #define nginx_version       007050 
    12 #define NGINX_VERSION      "0.7.50" 
     11#define nginx_version       007051 
     12#define NGINX_VERSION      "0.7.51" 
    1313#define NGINX_VER          "nginx/" NGINX_VERSION 
    1414 
  • server/src/core/ngx_cycle.c

    re61f2d r60fc2a  
    376376        } 
    377377 
    378 #if (NGX_WIN32) 
    379         if (ngx_file_append_mode(file[i].fd) != NGX_OK) { 
    380             ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, 
    381                           ngx_file_append_mode_n " \"%s\" failed", 
    382                           file[i].name.data); 
    383             goto failed; 
    384         } 
    385 #else 
     378#if !(NGX_WIN32) 
    386379        if (fcntl(file[i].fd, F_SETFD, FD_CLOEXEC) == -1) { 
    387380            ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, 
     
    930923ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log) 
    931924{ 
    932     size_t            len; 
    933     ngx_uint_t        trunc; 
    934     ngx_file_t        file; 
    935     u_char            pid[NGX_INT64_LEN + 2]; 
     925    size_t      len; 
     926    ngx_uint_t  create; 
     927    ngx_file_t  file; 
     928    u_char      pid[NGX_INT64_LEN + 2]; 
    936929 
    937930    ngx_memzero(&file, sizeof(ngx_file_t)); 
     
    940933    file.log = log; 
    941934 
    942     trunc = ngx_test_config ? 0 : NGX_FILE_TRUNCATE; 
     935    create = ngx_test_config ? NGX_FILE_CREATE_OR_OPEN : NGX_FILE_TRUNCATE; 
    943936 
    944937    file.fd = ngx_open_file(file.name.data, NGX_FILE_RDWR, 
    945                             NGX_FILE_CREATE_OR_OPEN|trunc, 
    946                             NGX_FILE_DEFAULT_ACCESS); 
     938                            create, NGX_FILE_DEFAULT_ACCESS); 
    947939 
    948940    if (file.fd == NGX_INVALID_FILE) { 
     
    10791071        } 
    10801072 
    1081 #if (NGX_WIN32) 
    1082         if (ngx_file_append_mode(fd) == NGX_ERROR) { 
    1083             ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, 
    1084                           ngx_file_append_mode_n " \"%s\" failed", 
    1085                           file[i].name.data); 
    1086  
    1087             if (ngx_close_file(fd) == NGX_FILE_ERROR) { 
    1088                 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, 
    1089                               ngx_close_file_n " \"%s\" failed", 
    1090                               file[i].name.data); 
    1091             } 
    1092  
    1093             continue; 
    1094         } 
    1095 #else 
     1073#if !(NGX_WIN32) 
    10961074        if (user != (ngx_uid_t) NGX_CONF_UNSET_UINT) { 
    10971075            ngx_file_info_t  fi; 
  • server/src/http/modules/perl/nginx.pm

    rc1871c r60fc2a  
    4848); 
    4949 
    50 our $VERSION = '0.7.50'; 
     50our $VERSION = '0.7.51'; 
    5151 
    5252require XSLoader; 
  • server/src/http/ngx_http.c

    rcbed21 r60fc2a  
    13741374    ngx_array_t *ports) 
    13751375{ 
    1376     ngx_uint_t                s, p, a; 
    1377     ngx_http_conf_port_t     *port; 
    1378     ngx_http_conf_addr_t     *addr; 
    1379     ngx_http_server_name_t   *name; 
     1376    ngx_uint_t               s, p, a; 
     1377    ngx_http_conf_port_t    *port; 
     1378    ngx_http_conf_addr_t    *addr; 
     1379    ngx_http_server_name_t  *name; 
    13801380 
    13811381    port = ports->elts; 
     
    14261426    ngx_http_conf_addr_t *addr) 
    14271427{ 
    1428     ngx_int_t                  rc; 
    1429     ngx_uint_t                 s; 
    1430     ngx_hash_init_t            hash; 
    1431     ngx_http_server_name_t    *name; 
    1432     ngx_hash_keys_arrays_t     ha; 
     1428    ngx_int_t                rc; 
     1429    ngx_uint_t               s; 
     1430    ngx_hash_init_t          hash; 
     1431    ngx_hash_keys_arrays_t   ha; 
     1432    ngx_http_server_name_t  *name; 
    14331433#if (NGX_PCRE) 
    1434     ngx_uint_t                 regex, i; 
     1434    ngx_uint_t               regex, i; 
    14351435 
    14361436    regex = 0; 
     
    18261826        } 
    18271827 
    1828         addrs[i].conf.core_srv_conf->virtual_names = vn; 
     1828        addrs[i].conf.virtual_names = vn; 
    18291829 
    18301830        vn->names.hash = addr[i].hash; 
     
    18831883        } 
    18841884 
    1885         addrs6[i].conf.core_srv_conf->virtual_names = vn; 
     1885        addrs6[i].conf.virtual_names = vn; 
    18861886 
    18871887        vn->names.hash = addr[i].hash; 
  • server/src/http/ngx_http_core_module.c

    r8284da r60fc2a  
    11441144 
    11451145        if (tf->lengths == NULL && tf->name.len == 0) { 
     1146 
     1147            if (tf->code) { 
     1148                ngx_http_finalize_request(r, tf->code); 
     1149                return NGX_OK; 
     1150            } 
    11461151 
    11471152            path.len -= root; 
     
    38763881    args.data = NULL; 
    38773882 
    3878     if (cv.lengths == NULL) { 
     3883    if (cv.lengths == NULL && uri.data[0] == '/') { 
    38793884        p = (u_char *) ngx_strchr(uri.data, '?'); 
    38803885 
     
    39403945 
    39413946    ngx_str_t                  *value; 
     3947    ngx_int_t                   code; 
    39423948    ngx_uint_t                  i, n; 
    39433949    ngx_http_try_file_t        *tf; 
     
    39954001    } 
    39964002 
     4003    if (tf[i - 1].name.data[0] == '=') { 
     4004 
     4005        code = ngx_atoi(tf[i - 1].name.data + 1, tf[i - 1].name.len - 2); 
     4006 
     4007        if (code == NGX_ERROR) { 
     4008            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 
     4009                               "invalid code \"%*s\"", 
     4010                               tf[i - 1].name.len - 1, tf[i - 1].name.data); 
     4011            return NGX_CONF_ERROR; 
     4012        } 
     4013 
     4014        tf[i].code = code; 
     4015    } 
     4016 
    39974017    return NGX_CONF_OK; 
    39984018} 
  • server/src/http/ngx_http_core_module.h

    rcbed21 r60fc2a  
    154154    ngx_http_conf_ctx_t        *ctx; 
    155155 
    156     ngx_http_virtual_names_t   *virtual_names; 
    157  
    158156    ngx_str_t                   server_name; 
    159157 
     
    180178    /* the default server configuration for this address:port */ 
    181179    ngx_http_core_srv_conf_t  *core_srv_conf; 
     180 
     181    ngx_http_virtual_names_t  *virtual_names; 
    182182 
    183183#if (NGX_HTTP_SSL) 
     
    268268    ngx_array_t               *values; 
    269269    ngx_str_t                  name; 
    270     ngx_uint_t                 test_dir;   /* unsigned  test_dir:1; */ 
     270 
     271    unsigned                   code:10; 
     272    unsigned                   test_dir:1; 
    271273} ngx_http_try_file_t; 
    272274 
  • server/src/http/ngx_http_file_cache.c

    rc5dd4c r60fc2a  
    418418        ngx_shmtx_unlock(&cache->shpool->mutex); 
    419419 
    420         ngx_http_file_cache_forced_expire(cache); 
     420        (void) ngx_http_file_cache_forced_expire(cache); 
    421421 
    422422        ngx_shmtx_lock(&cache->shpool->mutex); 
     
    819819    name = ngx_alloc(len + 1, ngx_cycle->log); 
    820820    if (name == NULL) { 
    821         return 60; 
     821        return 10; 
    822822    } 
    823823 
    824824    ngx_memcpy(name, path->name.data, path->name.len); 
    825825 
    826     wait = 60; 
     826    wait = 10; 
    827827    tries = 0; 
    828828 
     
    892892    name = ngx_alloc(len + 1, ngx_cycle->log); 
    893893    if (name == NULL) { 
    894         return 60; 
     894        return 10; 
    895895    } 
    896896 
     
    904904 
    905905        if (ngx_queue_empty(cache->queue)) { 
    906             wait = 60; 
     906            wait = 10; 
    907907            break; 
    908908        } 
     
    915915 
    916916        if (wait > 0) { 
    917             wait = wait > 60 ? 60 : wait; 
     917            wait = wait > 10 ? 10 : wait; 
    918918            break; 
    919919        } 
     
    10431043 
    10441044        if (ngx_walk_tree(&tree, &cache->path->name) == NGX_ABORT) { 
    1045             return 60; 
     1045            return 10; 
    10461046        } 
    10471047 
  • server/src/http/ngx_http_header_filter_module.c

    r48f6cd r60fc2a  
    6262    /* ngx_null_string, */  /* "207 Multi-Status" */ 
    6363 
    64 #define NGX_HTTP_LEVEL_200  7 
     64#define NGX_HTTP_LAST_LEVEL_200  207 
     65#define NGX_HTTP_LEVEL_200       (NGX_HTTP_LAST_LEVEL_200 - 200) 
    6566 
    6667    /* ngx_null_string, */  /* "300 Multiple Choices" */ 
     
    7576    /* ngx_null_string, */  /* "307 Temporary Redirect" */ 
    7677 
    77 #define NGX_HTTP_LEVEL_300  4 
     78#define NGX_HTTP_LAST_LEVEL_300  305 
     79#define NGX_HTTP_LEVEL_300       (NGX_HTTP_LAST_LEVEL_300 - 301) 
    7880 
    7981    ngx_string("400 Bad Request"), 
     
    107109    /* ngx_null_string, */  /* "424 Failed Dependency" */ 
    108110 
    109 #define NGX_HTTP_LEVEL_400  17 
     111#define NGX_HTTP_LAST_LEVEL_400  417 
     112#define NGX_HTTP_LEVEL_400       (NGX_HTTP_LAST_LEVEL_400 - 400) 
    110113 
    111114    ngx_string("500 Internal Server Error"), 
     
    121124    /* ngx_null_string, */  /* "509 unused" */ 
    122125    /* ngx_null_string, */  /* "510 Not Extended" */ 
     126 
     127#define NGX_HTTP_LAST_LEVEL_500  508 
     128 
    123129}; 
    124130 
     
    154160    u_char                    *p; 
    155161    size_t                     len; 
    156     ngx_str_t                  host; 
     162    ngx_str_t                  host, *status_line; 
    157163    ngx_buf_t                 *b; 
    158164    ngx_uint_t                 status, i, port; 
     
    200206    if (r->headers_out.status_line.len) { 
    201207        len += r->headers_out.status_line.len; 
     208        status_line = &r->headers_out.status_line; 
    202209#if (NGX_SUPPRESS_WARN) 
    203         status = NGX_INVALID_ARRAY_INDEX; 
     210        status = 0; 
    204211#endif 
    205212 
    206213    } else { 
    207214 
    208         if (r->headers_out.status < NGX_HTTP_MOVED_PERMANENTLY) { 
     215        status = r->headers_out.status; 
     216 
     217        if (status >= NGX_HTTP_OK 
     218            && status < NGX_HTTP_LAST_LEVEL_200) 
     219        { 
    209220            /* 2XX */ 
    210             status = r->headers_out.status - NGX_HTTP_OK; 
    211  
    212             if (r->headers_out.status == NGX_HTTP_NO_CONTENT) { 
     221 
     222            if (status == NGX_HTTP_NO_CONTENT) { 
    213223                r->header_only = 1; 
    214224                r->headers_out.content_type.len = 0; 
     
    220230            } 
    221231 
    222         } else if (r->headers_out.status < NGX_HTTP_BAD_REQUEST) { 
     232            status -= NGX_HTTP_OK; 
     233            status_line = &ngx_http_status_lines[status]; 
     234            len += ngx_http_status_lines[status].len; 
     235 
     236        } else if (status >= NGX_HTTP_MOVED_PERMANENTLY 
     237                   && status < NGX_HTTP_LAST_LEVEL_300) 
     238        { 
    223239            /* 3XX */ 
    224             status = r->headers_out.status - NGX_HTTP_MOVED_PERMANENTLY 
    225                                            + NGX_HTTP_LEVEL_200; 
    226  
    227             if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED) { 
     240 
     241            if (status == NGX_HTTP_NOT_MODIFIED) { 
    228242                r->header_only = 1; 
    229243            } 
    230244 
    231         } else if (r->headers_out.status < NGX_HTTP_INTERNAL_SERVER_ERROR) { 
     245            status = status - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200; 
     246            status_line = &ngx_http_status_lines[status]; 
     247            len += ngx_http_status_lines[status].len; 
     248 
     249        } else if (status >= NGX_HTTP_BAD_REQUEST 
     250                   && status < NGX_HTTP_LAST_LEVEL_400)  
     251        { 
    232252            /* 4XX */ 
    233             status = r->headers_out.status - NGX_HTTP_BAD_REQUEST 
    234                                            + NGX_HTTP_LEVEL_200 
    235                                            + NGX_HTTP_LEVEL_300; 
     253            status = status - NGX_HTTP_BAD_REQUEST 
     254                            + NGX_HTTP_LEVEL_200 
     255                            + NGX_HTTP_LEVEL_300; 
     256 
     257            status_line = &ngx_http_status_lines[status]; 
     258            len += ngx_http_status_lines[status].len; 
     259 
     260        } else if (status >= NGX_HTTP_INTERNAL_SERVER_ERROR 
     261                   && status < NGX_HTTP_LAST_LEVEL_500) 
     262        { 
     263            /* 5XX */ 
     264            status = status - NGX_HTTP_INTERNAL_SERVER_ERROR 
     265                            + NGX_HTTP_LEVEL_200 
     266                            + NGX_HTTP_LEVEL_300 
     267                            + NGX_HTTP_LEVEL_400; 
     268 
     269            status_line = &ngx_http_status_lines[status]; 
     270            len += ngx_http_status_lines[status].len; 
    236271 
    237272        } else { 
    238             /* 5XX */ 
    239             status = r->headers_out.status - NGX_HTTP_INTERNAL_SERVER_ERROR 
    240                                            + NGX_HTTP_LEVEL_200 
    241                                            + NGX_HTTP_LEVEL_300 
    242                                            + NGX_HTTP_LEVEL_400; 
    243         } 
    244  
    245         len += ngx_http_status_lines[status].len; 
     273            len += NGX_INT_T_LEN; 
     274            status_line = NULL; 
     275        } 
    246276    } 
    247277 
     
    401431 
    402432    /* status line */ 
    403     if (r->headers_out.status_line.len) { 
    404         b->last = ngx_copy(b->last, r->headers_out.status_line.data, 
    405                            r->headers_out.status_line.len); 
     433    if (status_line) { 
     434        b->last = ngx_copy(b->last, status_line->data, status_line->len); 
    406435 
    407436    } else { 
    408         b->last = ngx_copy(b->last, ngx_http_status_lines[status].data, 
    409                            ngx_http_status_lines[status].len); 
     437        b->last = ngx_sprintf(b->last, "%ui", status); 
    410438    } 
    411439    *b->last++ = CR; *b->last++ = LF; 
  • server/src/http/ngx_http_request.c

    rc5dd4c r60fc2a  
    373373    } 
    374374 
     375    r->virtual_names = addr_conf->virtual_names; 
     376 
    375377    /* the default server configuration for the address:port */ 
    376378    cscf = addr_conf->core_srv_conf; 
     
    16101612    u_char                    *server; 
    16111613    ngx_uint_t                 hash; 
    1612     ngx_http_virtual_names_t  *vn; 
    16131614    ngx_http_core_loc_conf_t  *clcf; 
    16141615    ngx_http_core_srv_conf_t  *cscf; 
    16151616    u_char                     buf[32]; 
    16161617 
    1617     cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); 
    1618     vn = cscf->virtual_names; 
    1619  
    1620     if (vn == NULL) { 
     1618    if (r->virtual_names == NULL) { 
    16211619        return NGX_DECLINED; 
    16221620    } 
     
    16341632    hash = ngx_hash_strlow(server, host, len); 
    16351633 
    1636     cscf = ngx_hash_find_combined(&vn->names, hash, server, len); 
     1634    cscf = ngx_hash_find_combined(&r->virtual_names->names, hash, server, len); 
    16371635 
    16381636    if (cscf) { 
     
    16421640#if (NGX_PCRE) 
    16431641 
    1644     if (vn->nregex) { 
     1642    if (r->virtual_names->nregex) { 
    16451643        size_t                   ncaptures; 
    16461644        ngx_int_t                n; 
     
    16541652        ncaptures = 0; 
    16551653 
    1656         sn = vn->regex; 
    1657  
    1658         for (i = 0; i < vn->nregex; i++) { 
     1654        sn = r->virtual_names->regex; 
     1655 
     1656        for (i = 0; i < r->virtual_names->nregex; i++) { 
    16591657 
    16601658            if (sn[i].captures && r->captures == NULL) { 
  • server/src/http/ngx_http_request.h

    rcbed21 r60fc2a  
    387387    ngx_http_post_subrequest_t       *post_subrequest; 
    388388    ngx_http_posted_request_t        *posted_requests; 
     389 
     390    ngx_http_virtual_names_t         *virtual_names; 
    389391 
    390392    ngx_int_t                         phase_handler; 
  • server/src/http/ngx_http_special_response.c

    rcbed21 r60fc2a  
    276276    ngx_null_string,                     /* 201, 204 */ 
    277277 
    278 #define NGX_HTTP_LEVEL_200  1 
     278#define NGX_HTTP_LAST_LEVEL_200  202 
     279#define NGX_HTTP_LEVEL_200       (NGX_HTTP_LAST_LEVEL_200 - 201) 
    279280 
    280281    /* ngx_null_string, */               /* 300 */ 
     
    283284    ngx_null_string,                     /* 303 */ 
    284285 
    285 #define NGX_HTTP_LEVEL_300  3 
     286#define NGX_HTTP_LAST_LEVEL_300  304 
     287#define NGX_HTTP_LEVEL_300       (NGX_HTTP_LAST_LEVEL_300 - 301) 
    286288 
    287289    ngx_string(ngx_http_error_400_page), 
     
    303305    ngx_string(ngx_http_error_416_page), 
    304306 
    305 #define NGX_HTTP_LEVEL_400  17 
     307#define NGX_HTTP_LAST_LEVEL_400  417 
     308#define NGX_HTTP_LEVEL_400       (NGX_HTTP_LAST_LEVEL_400 - 400) 
    306309 
    307310    ngx_string(ngx_http_error_495_page), /* 495, https certificate error */ 
     
    319322    ngx_null_string,                     /* 506 */ 
    320323    ngx_string(ngx_http_error_507_page) 
     324 
     325#define NGX_HTTP_LAST_LEVEL_500  508 
     326 
    321327}; 
    322328 
     
    403409        err = 0; 
    404410 
    405     } else if (error < NGX_HTTP_BAD_REQUEST) { 
     411    } else if (error >= NGX_HTTP_MOVED_PERMANENTLY 
     412               && error < NGX_HTTP_LAST_LEVEL_300) 
     413    { 
    406414        /* 3XX */ 
    407415        err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200; 
    408416 
    409     } else if (error < NGX_HTTP_OWN_CODES) { 
     417    } else if (error >= NGX_HTTP_BAD_REQUEST 
     418               && error < NGX_HTTP_LAST_LEVEL_400) 
     419    { 
    410420        /* 4XX */ 
    411421        err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_LEVEL_200 
    412422                                           + NGX_HTTP_LEVEL_300; 
    413423 
    414     } else { 
     424    } else if (error >= NGX_HTTP_OWN_CODES 
     425               && error < NGX_HTTP_LAST_LEVEL_500) 
     426    { 
    415427        /* 49X, 5XX */ 
    416428        err = error - NGX_HTTP_OWN_CODES + NGX_HTTP_LEVEL_200 
     
    424436                break; 
    425437        } 
     438 
     439    } else { 
     440        /* unknown code, zero body */ 
     441        err = 0; 
    426442    } 
    427443 
     
    452468    } 
    453469 
    454     if (err_page->value.lengths) { 
    455         ngx_http_split_args(r, &uri, &args); 
    456  
    457     } else { 
    458         args = err_page->args; 
    459     } 
    460  
    461470    if (uri.data[0] == '/') { 
     471 
     472        if (err_page->value.lengths) { 
     473            ngx_http_split_args(r, &uri, &args); 
     474 
     475        } else { 
     476            args = err_page->args; 
     477        } 
    462478 
    463479        if (r->method != NGX_HTTP_HEAD) { 
  • server/src/http/ngx_http_upstream.c

    rc5dd4c r60fc2a  
    19461946    } 
    19471947 
     1948    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, 
     1949                   "http cacheable: %d", u->cacheable); 
     1950 
    19481951#endif 
    19491952 
     
    27472750#if (NGX_HTTP_CACHE) 
    27482751 
    2749     if (r->cache) { 
     2752    if (u->cacheable) { 
    27502753        time_t  valid; 
    27512754 
     
    27692772#endif 
    27702773 
    2771     if (u->header_sent && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE)) 
     2774    if (u->header_sent 
     2775        && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE)) 
    27722776    { 
    27732777        rc = 0; 
  • server/src/os/unix/ngx_files.h

    re61f2d r60fc2a  
    6464#define NGX_FILE_CREATE_OR_OPEN  O_CREAT 
    6565#define NGX_FILE_OPEN            0 
    66 #define NGX_FILE_TRUNCATE        O_TRUNC 
     66#define NGX_FILE_TRUNCATE        O_CREAT|O_TRUNC 
    6767#define NGX_FILE_APPEND          O_WRONLY|O_APPEND 
    6868 
Note: See TracChangeset for help on using the changeset viewer.