From 991f1cded8aea69de0ab787834415f5c47f1ebc9 Mon Sep 17 00:00:00 2001 From: Andrew Canaday Date: Sat, 19 Jul 2014 06:58:53 +0800 Subject: [PATCH] Only check for '?' URI args during URI path parse --- lib/parsers.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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) {