pass length clearly

This commit is contained in:
Igor Sysoev 2007-10-01 12:57:47 +00:00
parent 06af5df77f
commit f53294103b
2 changed files with 8 additions and 8 deletions

View File

@ -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_request_t *r)
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_request_t *r)
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_request_t *r)
#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_request_t *r)
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;
}
}

View File

@ -2636,7 +2636,7 @@ ngx_http_upstream_rewrite_refresh(ngx_http_request_t *r, ngx_table_elt_t *h,
if (r->upstream->rewrite_redirect) {
p = ngx_strcasestrn(ho->value.data, "url=", 3);
p = ngx_strcasestrn(ho->value.data, "url=", 4 - 1);
if (p) {
rc = r->upstream->rewrite_redirect(r, ho, p + 4 - ho->value.data);