diff src/http/ngx_http_core_module.c @ 438:ce4f9ff90bfa NGINX_0_7_31

nginx 0.7.31 *) Change: now the "try_files" directive tests files only and ignores directories. *) Feature: the "fastcgi_split_path_info" directive. *) Bugfixes in an "Expect" request header line support. *) Bugfixes in geo ranges. *) Bugfix: in a miss case ngx_http_memcached_module returned the "END" line as response body instead of default 404 page body; the bug had appeared in 0.7.18. Thanks to Maxim Dounin. *) Bugfix: while SMTP proxying nginx issued message "250 2.0.0 OK" instead of "235 2.0.0 OK"; the bug had appeared in 0.7.22. Thanks to Maxim Dounin.
author Igor Sysoev <http://sysoev.ru>
date Mon, 19 Jan 2009 00:00:00 +0300
parents 49a0eb7ce20c
children 6281966854a5
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -23,7 +23,6 @@ typedef struct {
 static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r);
 static ngx_int_t ngx_http_core_find_static_location(ngx_http_request_t *r,
     ngx_http_location_tree_node_t *node);
-static ngx_int_t ngx_http_core_send_continue(ngx_http_request_t *r);
 
 static ngx_int_t ngx_http_core_preconfiguration(ngx_conf_t *cf);
 static void *ngx_http_core_create_main_conf(ngx_conf_t *cf);
@@ -818,7 +817,7 @@ ngx_http_core_find_config_phase(ngx_http
 {
     u_char                    *p;
     size_t                     len;
-    ngx_int_t                  rc, expect;
+    ngx_int_t                  rc;
     ngx_http_core_loc_conf_t  *clcf;
 
     r->content_handler = NULL;
@@ -862,15 +861,6 @@ ngx_http_core_find_config_phase(ngx_http
         return NGX_OK;
     }
 
-    if (r->headers_in.expect && r->http_version > NGX_HTTP_VERSION_10) {
-        expect = ngx_http_core_send_continue(r);
-
-        if (expect != NGX_OK) {
-            ngx_http_finalize_request(r, expect);
-            return NGX_OK;
-        }
-    }
-
     if (rc == NGX_DONE) {
         r->headers_out.location = ngx_list_push(&r->headers_out.headers);
         if (r->headers_out.location == NULL) {
@@ -1182,6 +1172,10 @@ ngx_http_core_try_files_phase(ngx_http_r
             continue;
         }
 
+        if (!of.is_file) {
+            continue;
+        }
+
         path.len -= root;
         path.data += root;
 
@@ -1490,45 +1484,6 @@ ngx_http_core_find_static_location(ngx_h
 }
 
 
-static ngx_int_t
-ngx_http_core_send_continue(ngx_http_request_t *r)
-{
-    ngx_int_t   n;
-    ngx_str_t  *expect;
-
-    if (r->expect_tested) {
-        return NGX_OK;
-    }
-
-    r->expect_tested = 1;
-
-    expect = &r->headers_in.expect->value;
-
-    if (expect->len != sizeof("100-continue") - 1
-        || ngx_strncasecmp(expect->data, (u_char *) "100-continue",
-                           sizeof("100-continue") - 1)
-           != 0)
-    {
-        return NGX_OK;
-    }
-
-    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-                   "send 100 Continue");
-
-    n = r->connection->send(r->connection,
-                            (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF,
-                            sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1);
-
-    if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) {
-        return NGX_OK;
-    }
-
-    /* we assume that such small packet should be send successfully */
-
-    return NGX_HTTP_INTERNAL_SERVER_ERROR;
-}
-
-
 void *
 ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash)
 {
@@ -2125,6 +2080,7 @@ ngx_http_subrequest(ngx_http_request_t *
     sr->internal = 1;
 
     sr->discard_body = r->discard_body;
+    sr->expect_tested = 1;
     sr->main_filter_need_in_memory = r->main_filter_need_in_memory;
 
     sr->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1;