Mercurial > hg > nginx-ranges
diff src/http/ngx_http_request.c @ 635:e67b227c8dbb default tip
Merge with current.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Apr 2011 04:07:55 +0400 |
parents | b9763778e212 |
children |
line wrap: on
line diff
--- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -88,6 +88,10 @@ ngx_http_header_t ngx_http_headers_in[] offsetof(ngx_http_headers_in_t, if_modified_since), ngx_http_process_unique_header_line }, + { ngx_string("If-Unmodified-Since"), + offsetof(ngx_http_headers_in_t, if_unmodified_since), + ngx_http_process_unique_header_line }, + { ngx_string("User-Agent"), offsetof(ngx_http_headers_in_t, user_agent), ngx_http_process_user_agent }, @@ -555,7 +559,7 @@ ngx_http_ssl_handshake(ngx_event_t *rev) } if (n == 1) { - if (buf[0] == 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) { + if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) { ngx_log_debug1(NGX_LOG_DEBUG_HTTP, rev->log, 0, "https ssl handshake: 0x%02Xd", buf[0]); @@ -756,6 +760,7 @@ ngx_http_process_request_line(ngx_event_ r->unparsed_uri.len = r->uri_end - r->uri_start; r->unparsed_uri.data = r->uri_start; + r->valid_unparsed_uri = r->space_in_uri ? 0 : 1; r->method_name.len = r->method_end - r->request_start + 1; r->method_name.data = r->request_line.data; @@ -788,16 +793,31 @@ ngx_http_process_request_line(ngx_event_ p = r->uri.data + r->uri.len - 1; - if (*p == '.' || *p == ' ') { - - while (--p > r->uri.data && (*p == '.' || *p == ' ')) { - /* void */ + while (p > r->uri.data) { + + if (*p == ' ') { + p--; + continue; + } + + if (*p == '.') { + p--; + continue; } + if (ngx_strncasecmp(p - 6, (u_char *) "::$data", 7) == 0) { + p -= 7; + continue; + } + + break; + } + + if (p != r->uri.data + r->uri.len - 1) { r->uri.len = p + 1 - r->uri.data; - ngx_http_set_exten(r); } + } #endif @@ -958,10 +978,13 @@ ngx_http_process_request_headers(ngx_eve if (rv == NGX_DECLINED) { p = r->header_name_start; + r->lingering_close = 1; + if (p == NULL) { ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent too large request"); - ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); + ngx_http_finalize_request(r, + NGX_HTTP_REQUEST_HEADER_TOO_LARGE); return; } @@ -975,7 +998,9 @@ ngx_http_process_request_headers(ngx_eve ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent too long header line: \"%*s\"", len, r->header_name_start); - ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); + + ngx_http_finalize_request(r, + NGX_HTTP_REQUEST_HEADER_TOO_LARGE); return; } } @@ -2569,6 +2594,7 @@ ngx_http_set_keepalive(ngx_http_request_ #endif c->idle = 1; + ngx_reusable_connection(c, 1); if (rev->ready) { ngx_post_event(rev, &ngx_posted_events); @@ -2678,6 +2704,7 @@ ngx_http_keepalive_handler(ngx_event_t * c->log->action = "reading client request line"; c->idle = 0; + ngx_reusable_connection(c, 0); ngx_http_init_request(rev); }