comparison src/http/ngx_http_request.c @ 680:597573166f34 NGINX_1_3_3

nginx 1.3.3 *) Feature: entity tags support and the "etag" directive. *) Bugfix: trailing dot in a source value was not ignored if the "map" directive was used with the "hostnames" parameter. *) Bugfix: incorrect location might be used to process a request if a URI was changed via a "rewrite" directive before an internal redirect to a named location.
author Igor Sysoev <http://sysoev.ru>
date Tue, 10 Jul 2012 00:00:00 +0400
parents 981b4c44593b
children 5cb5db9975ba
comparison
equal deleted inserted replaced
679:cad34cec7d3b 680:597573166f34
89 offsetof(ngx_http_headers_in_t, if_modified_since), 89 offsetof(ngx_http_headers_in_t, if_modified_since),
90 ngx_http_process_unique_header_line }, 90 ngx_http_process_unique_header_line },
91 91
92 { ngx_string("If-Unmodified-Since"), 92 { ngx_string("If-Unmodified-Since"),
93 offsetof(ngx_http_headers_in_t, if_unmodified_since), 93 offsetof(ngx_http_headers_in_t, if_unmodified_since),
94 ngx_http_process_unique_header_line },
95
96 { ngx_string("If-Match"),
97 offsetof(ngx_http_headers_in_t, if_match),
98 ngx_http_process_unique_header_line },
99
100 { ngx_string("If-None-Match"),
101 offsetof(ngx_http_headers_in_t, if_none_match),
94 ngx_http_process_unique_header_line }, 102 ngx_http_process_unique_header_line },
95 103
96 { ngx_string("User-Agent"), offsetof(ngx_http_headers_in_t, user_agent), 104 { ngx_string("User-Agent"), offsetof(ngx_http_headers_in_t, user_agent),
97 ngx_http_process_user_agent }, 105 ngx_http_process_user_agent },
98 106
745 753
746 /* the request line has been parsed successfully */ 754 /* the request line has been parsed successfully */
747 755
748 r->request_line.len = r->request_end - r->request_start; 756 r->request_line.len = r->request_end - r->request_start;
749 r->request_line.data = r->request_start; 757 r->request_line.data = r->request_start;
758 r->request_length = r->header_in->pos - r->request_start;
750 759
751 760
752 if (r->args_start) { 761 if (r->args_start) {
753 r->uri.len = r->args_start - 1 - r->uri_start; 762 r->uri.len = r->args_start - 1 - r->uri_start;
754 } else { 763 } else {
1054 rc = ngx_http_parse_header_line(r, r->header_in, 1063 rc = ngx_http_parse_header_line(r, r->header_in,
1055 cscf->underscores_in_headers); 1064 cscf->underscores_in_headers);
1056 1065
1057 if (rc == NGX_OK) { 1066 if (rc == NGX_OK) {
1058 1067
1068 r->request_length += r->header_in->pos - r->header_name_start;
1069
1059 if (r->invalid_header && cscf->ignore_invalid_headers) { 1070 if (r->invalid_header && cscf->ignore_invalid_headers) {
1060 1071
1061 /* there was error while a header line parsing */ 1072 /* there was error while a header line parsing */
1062 1073
1063 ngx_log_error(NGX_LOG_INFO, c->log, 0, 1074 ngx_log_error(NGX_LOG_INFO, c->log, 0,
1117 /* a whole header has been parsed successfully */ 1128 /* a whole header has been parsed successfully */
1118 1129
1119 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1130 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1120 "http header done"); 1131 "http header done");
1121 1132
1122 r->request_length += r->header_in->pos - r->header_in->start; 1133 r->request_length += r->header_in->pos - r->header_name_start;
1123 1134
1124 r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE; 1135 r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE;
1125 1136
1126 rc = ngx_http_process_request_header(r); 1137 rc = ngx_http_process_request_header(r);
1127 1138
1223 "http alloc large header buffer"); 1234 "http alloc large header buffer");
1224 1235
1225 if (request_line && r->state == 0) { 1236 if (request_line && r->state == 0) {
1226 1237
1227 /* the client fills up the buffer with "\r\n" */ 1238 /* the client fills up the buffer with "\r\n" */
1228
1229 r->request_length += r->header_in->end - r->header_in->start;
1230 1239
1231 r->header_in->pos = r->header_in->start; 1240 r->header_in->pos = r->header_in->start;
1232 r->header_in->last = r->header_in->start; 1241 r->header_in->last = r->header_in->start;
1233 1242
1234 return NGX_OK; 1243 return NGX_OK;
1285 * r->state == 0 means that a header line was parsed successfully 1294 * r->state == 0 means that a header line was parsed successfully
1286 * and we do not need to copy incomplete header line and 1295 * and we do not need to copy incomplete header line and
1287 * to relocate the parser header pointers 1296 * to relocate the parser header pointers
1288 */ 1297 */
1289 1298
1290 r->request_length += r->header_in->end - r->header_in->start;
1291
1292 r->header_in = b; 1299 r->header_in = b;
1293 1300
1294 return NGX_OK; 1301 return NGX_OK;
1295 } 1302 }
1296 1303
1297 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1304 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1298 "http large header copy: %d", r->header_in->pos - old); 1305 "http large header copy: %d", r->header_in->pos - old);
1299
1300 r->request_length += old - r->header_in->start;
1301 1306
1302 new = b->start; 1307 new = b->start;
1303 1308
1304 ngx_memcpy(new, old, r->header_in->pos - old); 1309 ngx_memcpy(new, old, r->header_in->pos - old);
1305 1310