comparison src/http/modules/ngx_http_scgi_module.c @ 644:ad25218fd14b NGINX_1_0_12

nginx 1.0.12 *) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the "ssl_protocols" directive. *) Feature: the "if" SSI command supports captures in regular expressions. *) Bugfix: the "if" SSI command did not work inside the "block" command. *) Bugfix: in AIO error handling on FreeBSD. *) Bugfix: in the OpenSSL library initialization. *) Bugfix: the "worker_cpu_affinity" directive might not work. *) Bugfix: the "limit_conn_log_level" and "limit_req_log_level" directives might not work. *) Bugfix: the "read_ahead" directive might not work combined with "try_files" and "open_file_cache". *) Bugfix: the "proxy_cache_use_stale" directive with "error" parameter did not return answer from cache if there were no live upstreams. *) Bugfix: a segmentation fault might occur in a worker process if small time was used in the "inactive" parameter of the "proxy_cache_path" directive. *) Bugfix: responses from cache might hang. *) Bugfix: in error handling while connecting to a backend. Thanks to Piotr Sikora. *) Bugfix: in the "epoll" event method. Thanks to Yichun Zhang. *) Bugfix: the $sent_http_cache_control variable might contain a wrong value if the "expires" directive was used. Thanks to Yichun Zhang. *) Bugfix: the "limit_rate" directive did not allow to use full throughput, even if limit value was very high. *) Bugfix: the "sendfile_max_chunk" directive did not work, if the "limit_rate" directive was used. *) Bugfix: nginx could not be built on Solaris; the bug had appeared in 1.0.11. *) Bugfix: in the ngx_http_scgi_module. *) Bugfix: in the ngx_http_mp4_module.
author Igor Sysoev <http://sysoev.ru>
date Mon, 06 Feb 2012 00:00:00 +0400
parents 1b80544421e8
children fa9b9e42035e
comparison
equal deleted inserted replaced
643:d81e1c257a02 644:ad25218fd14b
1 1
2 /* 2 /*
3 * Copyright (C) Igor Sysoev 3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Nginx, Inc.
4 * Copyright (C) Manlio Perillo (manlio.perillo@gmail.com) 5 * Copyright (C) Manlio Perillo (manlio.perillo@gmail.com)
5 */ 6 */
6 7
7 8
8 #include <ngx_config.h> 9 #include <ngx_config.h>
33 static ngx_int_t ngx_http_scgi_eval(ngx_http_request_t *r, 34 static ngx_int_t ngx_http_scgi_eval(ngx_http_request_t *r,
34 ngx_http_scgi_loc_conf_t *scf); 35 ngx_http_scgi_loc_conf_t *scf);
35 static ngx_int_t ngx_http_scgi_create_request(ngx_http_request_t *r); 36 static ngx_int_t ngx_http_scgi_create_request(ngx_http_request_t *r);
36 static ngx_int_t ngx_http_scgi_reinit_request(ngx_http_request_t *r); 37 static ngx_int_t ngx_http_scgi_reinit_request(ngx_http_request_t *r);
37 static ngx_int_t ngx_http_scgi_process_status_line(ngx_http_request_t *r); 38 static ngx_int_t ngx_http_scgi_process_status_line(ngx_http_request_t *r);
38 static ngx_int_t ngx_http_scgi_process_header(ngx_http_request_t *r);
39 static ngx_int_t ngx_http_scgi_process_header(ngx_http_request_t *r); 39 static ngx_int_t ngx_http_scgi_process_header(ngx_http_request_t *r);
40 static void ngx_http_scgi_abort_request(ngx_http_request_t *r); 40 static void ngx_http_scgi_abort_request(ngx_http_request_t *r);
41 static void ngx_http_scgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc); 41 static void ngx_http_scgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc);
42 42
43 static void *ngx_http_scgi_create_loc_conf(ngx_conf_t *cf); 43 static void *ngx_http_scgi_create_loc_conf(ngx_conf_t *cf);
822 if (rc == NGX_AGAIN) { 822 if (rc == NGX_AGAIN) {
823 return rc; 823 return rc;
824 } 824 }
825 825
826 if (rc == NGX_ERROR) { 826 if (rc == NGX_ERROR) {
827
828 r->http_version = NGX_HTTP_VERSION_9;
829
830 u->process_header = ngx_http_scgi_process_header; 827 u->process_header = ngx_http_scgi_process_header;
831
832 return ngx_http_scgi_process_header(r); 828 return ngx_http_scgi_process_header(r);
833 } 829 }
834 830
835 if (u->state) { 831 if (u->state) {
836 u->state->status = status->code; 832 u->state->status = status->code;
926 /* a whole header has been parsed successfully */ 922 /* a whole header has been parsed successfully */
927 923
928 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 924 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
929 "http scgi header done"); 925 "http scgi header done");
930 926
931 if (r->http_version > NGX_HTTP_VERSION_9) { 927 u = r->upstream;
928
929 if (u->headers_in.status_n) {
932 return NGX_OK; 930 return NGX_OK;
933 } 931 }
934
935 u = r->upstream;
936 932
937 if (u->headers_in.status) { 933 if (u->headers_in.status) {
938 status_line = &u->headers_in.status->value; 934 status_line = &u->headers_in.status->value;
939 935
940 status = ngx_atoi(status_line->data, 3); 936 status = ngx_atoi(status_line->data, 3);
943 "upstream sent invalid status \"%V\"", 939 "upstream sent invalid status \"%V\"",
944 status_line); 940 status_line);
945 return NGX_HTTP_UPSTREAM_INVALID_HEADER; 941 return NGX_HTTP_UPSTREAM_INVALID_HEADER;
946 } 942 }
947 943
948 r->http_version = NGX_HTTP_VERSION_10;
949 u->headers_in.status_n = status; 944 u->headers_in.status_n = status;
950 u->headers_in.status_line = *status_line; 945 u->headers_in.status_line = *status_line;
951 946
952 } else if (u->headers_in.location) { 947 } else if (u->headers_in.location) {
953 r->http_version = NGX_HTTP_VERSION_10;
954 u->headers_in.status_n = 302; 948 u->headers_in.status_n = 302;
955 ngx_str_set(&u->headers_in.status_line, 949 ngx_str_set(&u->headers_in.status_line,
956 "302 Moved Temporarily"); 950 "302 Moved Temporarily");
957 951
958 } else { 952 } else {
959 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
960 "upstream sent neither valid HTTP/1.0 header "
961 "nor \"Status\" header line");
962 u->headers_in.status_n = 200; 953 u->headers_in.status_n = 200;
963 ngx_str_set(&u->headers_in.status_line, "200 OK"); 954 ngx_str_set(&u->headers_in.status_line, "200 OK");
964 } 955 }
965 956
966 if (u->state) { 957 if (u->state) {
1243 |NGX_HTTP_UPSTREAM_FT_OFF)); 1234 |NGX_HTTP_UPSTREAM_FT_OFF));
1244 1235
1245 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) { 1236 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
1246 conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET 1237 conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
1247 |NGX_HTTP_UPSTREAM_FT_OFF; 1238 |NGX_HTTP_UPSTREAM_FT_OFF;
1239 }
1240
1241 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) {
1242 conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE;
1248 } 1243 }
1249 1244
1250 if (conf->upstream.cache_methods == 0) { 1245 if (conf->upstream.cache_methods == 0) {
1251 conf->upstream.cache_methods = prev->upstream.cache_methods; 1246 conf->upstream.cache_methods = prev->upstream.cache_methods;
1252 } 1247 }