diff --git a/lib/parsers.c b/lib/parsers.c index 9626cd20..ac9eda12 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -365,16 +365,6 @@ int libwebsocket_parse( break; } -check_eol: - - /* bail at EOL */ - if (wsi->u.hdr.parser_state != WSI_TOKEN_CHALLENGE && - c == '\x0d') { - c = '\0'; - wsi->u.hdr.parser_state = WSI_TOKEN_SKIPPING_SAW_CR; - lwsl_parser("*\n"); - } - if (c == '?') { /* start of URI arguments */ /* seal off uri header */ wsi->u.hdr.ah->data[wsi->u.hdr.ah->pos++] = '\0'; @@ -397,6 +387,16 @@ check_eol: goto swallow; } +check_eol: + + /* bail at EOL */ + if (wsi->u.hdr.parser_state != WSI_TOKEN_CHALLENGE && + c == '\x0d') { + c = '\0'; + wsi->u.hdr.parser_state = WSI_TOKEN_SKIPPING_SAW_CR; + lwsl_parser("*\n"); + } + { int issue_result = issue_char(wsi, c); if (issue_result < 0) {