[nginx] Minor ngx_http_parse_request_line() optimization.

Maxim Dounin mdounin at mdounin.ru
Wed Aug 21 10:55:17 UTC 2013


details:   http://hg.nginx.org/nginx/rev/17291cb8c76e
branches:  
changeset: 5328:17291cb8c76e
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Wed Aug 21 12:51:31 2013 +0400
description:
Minor ngx_http_parse_request_line() optimization.

Noted by Nils Kuhnhenn.

diffstat:

 src/http/ngx_http_parse.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (21 lines):

diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -212,14 +212,17 @@ ngx_http_parse_request_line(ngx_http_req
                 case 5:
                     if (ngx_str5cmp(m, 'M', 'K', 'C', 'O', 'L')) {
                         r->method = NGX_HTTP_MKCOL;
+                        break;
                     }
 
                     if (ngx_str5cmp(m, 'P', 'A', 'T', 'C', 'H')) {
                         r->method = NGX_HTTP_PATCH;
+                        break;
                     }
 
                     if (ngx_str5cmp(m, 'T', 'R', 'A', 'C', 'E')) {
                         r->method = NGX_HTTP_TRACE;
+                        break;
                     }
 
                     break;



More information about the nginx-devel mailing list