aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-09-26 19:26:14 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-09-26 19:26:14 +0000
commit0659720dc87e606498a13e753299396bceb07188 (patch)
tree1bad40c2edb577679df346cf7b9aff72c187a8e1 /src/http/ngx_http_request.c
parent1bd987019d4700636e2ded5acfae7a81185a512e (diff)
downloadnginx-0659720dc87e606498a13e753299396bceb07188.tar.gz
nginx-0659720dc87e606498a13e753299396bceb07188.zip
use ngx_strstrn() and ngx_strcasestrn()
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index d7843c62a..9e0a41eeb 100644
--- 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_strstr(h->value.data, "close")) {
+ if (ngx_strcasestrn(h->value.data, "close", 4)) {
r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE;
- } else if (ngx_strstr(h->value.data, "keep-alive")) {
+ } else if (ngx_strcasestrn(h->value.data, "keep-alive", 9)) {
r->headers_in.connection_type = NGX_HTTP_CONNECTION_KEEP_ALIVE;
}
@@ -1319,7 +1319,8 @@ ngx_http_process_request_header(ngx_http_request_t *r)
}
if (r->headers_in.transfer_encoding
- && ngx_strstr(r->headers_in.transfer_encoding->value.data, "chunked"))
+ && ngx_strcasestrn(r->headers_in.transfer_encoding->value.data,
+ "chunked", 6))
{
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
"client sent \"Transfer-Encoding: chunked\" header");
@@ -1351,7 +1352,7 @@ ngx_http_process_request_header(ngx_http_request_t *r)
user_agent = r->headers_in.user_agent->value.data;
- ua = (u_char *) ngx_strstr(user_agent, "MSIE");
+ ua = ngx_strstrn(user_agent, "MSIE", 3);
if (ua && ua + 8 < user_agent + r->headers_in.user_agent->value.len) {
@@ -1369,7 +1370,7 @@ ngx_http_process_request_header(ngx_http_request_t *r)
#endif
}
- if (ngx_strstr(user_agent, "Opera")) {
+ if (ngx_strstrn(user_agent, "Opera", 4)) {
r->headers_in.opera = 1;
r->headers_in.msie = 0;
r->headers_in.msie4 = 0;
@@ -1377,10 +1378,10 @@ ngx_http_process_request_header(ngx_http_request_t *r)
if (!r->headers_in.msie && !r->headers_in.opera) {
- if (ngx_strstr(user_agent, "Gecko/")) {
+ if (ngx_strstrn(user_agent, "Gecko/", 5)) {
r->headers_in.gecko = 1;
- } else if (ngx_strstr(user_agent, "Konqueror")) {
+ } else if (ngx_strstrn(user_agent, "Konqueror", 8)) {
r->headers_in.konqueror = 1;
}
}