208
210
r->method = NGX_HTTP_MKCOL;
213
if (ngx_str5cmp(m, 'P', 'A', 'T', 'C', 'H')) {
214
r->method = NGX_HTTP_PATCH;
211
217
if (ngx_str5cmp(m, 'T', 'R', 'A', 'C', 'E')) {
212
218
r->method = NGX_HTTP_TRACE;
380
386
r->uri_start = r->schema_end + 1;
381
387
r->uri_end = r->schema_end + 2;
385
return NGX_HTTP_PARSE_INVALID_REQUEST;
388
state = sw_host_http_09;
391
return NGX_HTTP_PARSE_INVALID_REQUEST;
395
/* space+ after "http://host[:port] " */
396
case sw_host_http_09:
402
state = sw_almost_done;
408
r->http_protocol.data = p;
412
return NGX_HTTP_PARSE_INVALID_REQUEST;
389
417
/* check "/.", "//", "%", and "\" (Win32) in URI */
390
418
case sw_after_slash_in_uri:
1321
ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
1322
ngx_http_status_t *status)
1332
sw_first_major_digit,
1334
sw_first_minor_digit,
1337
sw_space_after_status,
1344
for (p = b->pos; p < b->last; p++) {
1393
state = sw_first_major_digit;
1400
/* the first digit of major HTTP version */
1401
case sw_first_major_digit:
1402
if (ch < '1' || ch > '9') {
1406
state = sw_major_digit;
1409
/* the major HTTP version or dot */
1410
case sw_major_digit:
1412
state = sw_first_minor_digit;
1416
if (ch < '0' || ch > '9') {
1422
/* the first digit of minor HTTP version */
1423
case sw_first_minor_digit:
1424
if (ch < '0' || ch > '9') {
1428
state = sw_minor_digit;
1431
/* the minor HTTP version or the end of the request line */
1432
case sw_minor_digit:
1438
if (ch < '0' || ch > '9') {
1444
/* HTTP status code */
1450
if (ch < '0' || ch > '9') {
1454
status->code = status->code * 10 + ch - '0';
1456
if (++status->count == 3) {
1457
state = sw_space_after_status;
1458
status->start = p - 2;
1463
/* space or end of line */
1464
case sw_space_after_status:
1467
state = sw_status_text;
1469
case '.': /* IIS may send 403.1, 403.2, etc */
1470
state = sw_status_text;
1473
state = sw_almost_done;
1482
/* any text until end of line */
1483
case sw_status_text:
1486
state = sw_almost_done;
1494
/* end of status line */
1495
case sw_almost_done:
1496
status->end = p - 1;
1515
if (status->end == NULL) {
1519
r->state = sw_start;
1270
1526
ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri,
1271
1527
ngx_str_t *args, ngx_uint_t *flags)