Mercurial > hg > nginx
comparison src/http/ngx_http_parse.c @ 8650:9dce2978e4fd quic
HTTP/3: eliminated r->method_start.
The field was introduced to ease parsing HTTP/3 requests.
The change reduces diff to the default branch.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Wed, 25 Nov 2020 17:57:43 +0000 |
parents | 9ffef6054abf |
children | f61d347158d0 |
comparison
equal
deleted
inserted
replaced
8649:5a92523e50d3 | 8650:9dce2978e4fd |
---|---|
143 | 143 |
144 /* HTTP methods: GET, HEAD, POST */ | 144 /* HTTP methods: GET, HEAD, POST */ |
145 case sw_start: | 145 case sw_start: |
146 r->parse_start = p; | 146 r->parse_start = p; |
147 r->request_start = p; | 147 r->request_start = p; |
148 r->method_start = p; | |
149 | 148 |
150 if (ch == CR || ch == LF) { | 149 if (ch == CR || ch == LF) { |
151 break; | 150 break; |
152 } | 151 } |
153 | 152 |
158 state = sw_method; | 157 state = sw_method; |
159 break; | 158 break; |
160 | 159 |
161 case sw_method: | 160 case sw_method: |
162 if (ch == ' ') { | 161 if (ch == ' ') { |
163 r->method_end = p; | 162 r->method_end = p - 1; |
164 m = r->request_start; | 163 m = r->request_start; |
165 | 164 |
166 switch (p - m) { | 165 switch (p - m) { |
167 | 166 |
168 case 3: | 167 case 3: |
829 | 828 |
830 b->pos = p + 1; | 829 b->pos = p + 1; |
831 | 830 |
832 if (r->request_end == NULL) { | 831 if (r->request_end == NULL) { |
833 r->request_end = p; | 832 r->request_end = p; |
834 } | |
835 | |
836 if (r->http_protocol.data) { | |
837 r->http_protocol.len = r->request_end - r->http_protocol.data; | |
838 } | 833 } |
839 | 834 |
840 r->http_version = r->http_major * 1000 + r->http_minor; | 835 r->http_version = r->http_major * 1000 + r->http_minor; |
841 r->state = sw_start; | 836 r->state = sw_start; |
842 | 837 |