diff src/http/ngx_http_request.c @ 1549:099d8470e6c3

pass length clearly
author Igor Sysoev <igor@sysoev.ru>
date Mon, 01 Oct 2007 12:57:47 +0000
parents 8596627c4cc5
children 4435ca2e467d
line wrap: on
line diff
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1204,10 +1204,10 @@ static ngx_int_t
 ngx_http_process_connection(ngx_http_request_t *r, ngx_table_elt_t *h,
     ngx_uint_t offset)
 {
-    if (ngx_strcasestrn(h->value.data, "close", 4)) {
+    if (ngx_strcasestrn(h->value.data, "close", 5 - 1)) {
         r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE;
 
-    } else if (ngx_strcasestrn(h->value.data, "keep-alive", 9)) {
+    } else if (ngx_strcasestrn(h->value.data, "keep-alive", 10 - 1)) {
         r->headers_in.connection_type = NGX_HTTP_CONNECTION_KEEP_ALIVE;
     }
 
@@ -1320,7 +1320,7 @@ ngx_http_process_request_header(ngx_http
 
     if (r->headers_in.transfer_encoding
         && ngx_strcasestrn(r->headers_in.transfer_encoding->value.data,
-                           "chunked", 6))
+                           "chunked", 7 - 1))
     {
         ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
                       "client sent \"Transfer-Encoding: chunked\" header");
@@ -1352,7 +1352,7 @@ ngx_http_process_request_header(ngx_http
 
         user_agent = r->headers_in.user_agent->value.data;
 
-        ua = ngx_strstrn(user_agent, "MSIE", 3);
+        ua = ngx_strstrn(user_agent, "MSIE", 4 - 1);
 
         if (ua && ua + 8 < user_agent + r->headers_in.user_agent->value.len) {
 
@@ -1370,7 +1370,7 @@ ngx_http_process_request_header(ngx_http
 #endif
         }
 
-        if (ngx_strstrn(user_agent, "Opera", 4)) {
+        if (ngx_strstrn(user_agent, "Opera", 5 - 1)) {
             r->headers_in.opera = 1;
             r->headers_in.msie = 0;
             r->headers_in.msie4 = 0;
@@ -1378,10 +1378,10 @@ ngx_http_process_request_header(ngx_http
 
         if (!r->headers_in.msie && !r->headers_in.opera) {
 
-            if (ngx_strstrn(user_agent, "Gecko/", 5)) {
+            if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) {
                 r->headers_in.gecko = 1;
 
-            } else if (ngx_strstrn(user_agent, "Konqueror", 8)) {
+            } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {
                 r->headers_in.konqueror = 1;
             }
         }