comparison src/http/ngx_http_core_module.c @ 132:91372f004adf NGINX_0_3_13

nginx 0.3.13 *) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS. *) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and /dev/poll methods. *) Bugfix: in SSI handling. *) Bugfix: now Solaris sendfilev() is not used to transfer the client request body to FastCGI-server via the unix domain socket. *) Bugfix: the "auth_basic" directive did not disable the authorization; bug appeared in 0.3.11.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Dec 2005 00:00:00 +0300
parents 82d695e3d662
children 8e6d4d96ec4c
comparison
equal deleted inserted replaced
131:add6b1e86d38 132:91372f004adf
964 ngx_int_t 964 ngx_int_t
965 ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in) 965 ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in)
966 { 966 {
967 ngx_int_t rc; 967 ngx_int_t rc;
968 968
969 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 969 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
970 "http output filter \"%V\"", &r->uri); 970 "http output filter \"%V?%V\"", &r->uri, &r->args);
971 971
972 rc = ngx_http_top_body_filter(r, in); 972 rc = ngx_http_top_body_filter(r, in);
973 973
974 if (rc == NGX_ERROR) { 974 if (rc == NGX_ERROR) {
975 /* NGX_ERROR may be returned by any filter */ 975 /* NGX_ERROR may be returned by any filter */
976 r->connection->closed = 1; 976 r->connection->error = 1;
977 } 977 }
978 978
979 return rc; 979 return rc;
980 } 980 }
981 981
1078 1078
1079 ngx_int_t 1079 ngx_int_t
1080 ngx_http_subrequest(ngx_http_request_t *r, 1080 ngx_http_subrequest(ngx_http_request_t *r,
1081 ngx_str_t *uri, ngx_str_t *args, ngx_uint_t flags) 1081 ngx_str_t *uri, ngx_str_t *args, ngx_uint_t flags)
1082 { 1082 {
1083 ngx_connection_t *c;
1083 ngx_http_request_t *sr; 1084 ngx_http_request_t *sr;
1084 ngx_http_core_srv_conf_t *cscf; 1085 ngx_http_core_srv_conf_t *cscf;
1085 ngx_http_postponed_request_t *pr, *p; 1086 ngx_http_postponed_request_t *pr, *p;
1086 1087
1087 sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t)); 1088 sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t));
1088 if (sr == NULL) { 1089 if (sr == NULL) {
1089 return NGX_HTTP_INTERNAL_SERVER_ERROR; 1090 return NGX_HTTP_INTERNAL_SERVER_ERROR;
1090 } 1091 }
1091 1092
1092 sr->signature = NGX_HTTP_MODULE; 1093 sr->signature = NGX_HTTP_MODULE;
1093 sr->connection = r->connection; 1094
1095 c = r->connection;
1096 sr->connection = c;
1094 1097
1095 sr->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module); 1098 sr->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
1096 if (sr->ctx == NULL) { 1099 if (sr->ctx == NULL) {
1097 return NGX_HTTP_INTERNAL_SERVER_ERROR; 1100 return NGX_HTTP_INTERNAL_SERVER_ERROR;
1098 } 1101 }
1126 sr->http_major = r->http_minor; 1129 sr->http_major = r->http_minor;
1127 1130
1128 sr->request_line = r->request_line; 1131 sr->request_line = r->request_line;
1129 sr->uri = *uri; 1132 sr->uri = *uri;
1130 1133
1131 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1132 "http subrequest \"%V\"", uri);
1133
1134 if (args) { 1134 if (args) {
1135 sr->args = *args; 1135 sr->args = *args;
1136 1136 }
1137 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1137
1138 "http subrequest args \"%V\"", args); 1138 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
1139 } 1139 "http subrequest \"%V?%V\"", uri, &sr->args);
1140 1140
1141 if (flags & NGX_HTTP_ZERO_IN_URI) { 1141 if (flags & NGX_HTTP_ZERO_IN_URI) {
1142 sr->zero_in_uri = 1; 1142 sr->zero_in_uri = 1;
1143 } 1143 }
1144 1144
1153 sr->main = r->main; 1153 sr->main = r->main;
1154 sr->parent = r; 1154 sr->parent = r;
1155 sr->read_event_handler = ngx_http_request_empty_handler; 1155 sr->read_event_handler = ngx_http_request_empty_handler;
1156 sr->write_event_handler = ngx_http_request_empty_handler; 1156 sr->write_event_handler = ngx_http_request_empty_handler;
1157 1157
1158 if (r->connection->data == r) { 1158 if (c->data == r) {
1159 sr->connection->data = sr; 1159 c->data = sr;
1160 } 1160 }
1161 1161
1162 sr->in_addr = r->in_addr; 1162 sr->in_addr = r->in_addr;
1163 sr->port = r->port; 1163 sr->port = r->port;
1164 sr->port_text = r->port_text; 1164 sr->port_text = r->port_text;
1190 sr->discard_body = r->discard_body; 1190 sr->discard_body = r->discard_body;
1191 sr->main_filter_need_in_memory = r->main_filter_need_in_memory; 1191 sr->main_filter_need_in_memory = r->main_filter_need_in_memory;
1192 1192
1193 ngx_http_handler(sr); 1193 ngx_http_handler(sr);
1194 1194
1195 /* the request pool may be already destroyed */ 1195 #if (NGX_LOG_DEBUG)
1196 if (!c->destroyed) {
1197 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
1198 "http subrequest done \"%V?%V\"", uri, &sr->args);
1199 }
1200 #endif
1196 1201
1197 return NGX_OK; 1202 return NGX_OK;
1198 } 1203 }
1199 1204
1200 1205
1202 ngx_http_internal_redirect(ngx_http_request_t *r, 1207 ngx_http_internal_redirect(ngx_http_request_t *r,
1203 ngx_str_t *uri, ngx_str_t *args) 1208 ngx_str_t *uri, ngx_str_t *args)
1204 { 1209 {
1205 ngx_http_core_srv_conf_t *cscf; 1210 ngx_http_core_srv_conf_t *cscf;
1206 1211
1207 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1208 "internal redirect: \"%V\"", uri);
1209
1210 r->uri = *uri; 1212 r->uri = *uri;
1211 1213
1212 if (args) { 1214 if (args) {
1213 r->args = *args; 1215 r->args = *args;
1214
1215 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1216 "internal redirect args: \"%V\"", args);
1217 1216
1218 } else { 1217 } else {
1219 r->args.len = 0; 1218 r->args.len = 0;
1220 r->args.data = NULL; 1219 r->args.data = NULL;
1221 } 1220 }
1221
1222 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1223 "internal redirect: \"%V?%V\"", uri, &r->args);
1222 1224
1223 if (ngx_http_set_exten(r) != NGX_OK) { 1225 if (ngx_http_set_exten(r) != NGX_OK) {
1224 return NGX_HTTP_INTERNAL_SERVER_ERROR; 1226 return NGX_HTTP_INTERNAL_SERVER_ERROR;
1225 } 1227 }
1226 1228