mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
cleanup style in parser
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
fc9871ec24
commit
4b812fe4aa
1 changed files with 10 additions and 13 deletions
|
@ -317,8 +317,8 @@ int libwebsocket_parse(
|
|||
if (c == '.') {
|
||||
wsi->u.hdr.ups = URIPS_SEEN_SLASH_DOT;
|
||||
goto swallow;
|
||||
} else
|
||||
wsi->u.hdr.ups = URIPS_IDLE;
|
||||
}
|
||||
wsi->u.hdr.ups = URIPS_IDLE;
|
||||
break;
|
||||
case URIPS_SEEN_SLASH_DOT:
|
||||
/* swallow second . */
|
||||
|
@ -357,8 +357,8 @@ int libwebsocket_parse(
|
|||
/* last issued was /, so another / == // */
|
||||
if (c == '/')
|
||||
goto swallow;
|
||||
else /* last we issued was / so SEEN_SLASH */
|
||||
wsi->u.hdr.ups = URIPS_SEEN_SLASH;
|
||||
/* last we issued was / so SEEN_SLASH */
|
||||
wsi->u.hdr.ups = URIPS_SEEN_SLASH;
|
||||
break;
|
||||
case URIPS_ARGUMENTS:
|
||||
/* leave them alone */
|
||||
|
@ -397,15 +397,12 @@ check_eol:
|
|||
lwsl_parser("*\n");
|
||||
}
|
||||
|
||||
{
|
||||
int issue_result = issue_char(wsi, c);
|
||||
if (issue_result < 0) {
|
||||
return -1;
|
||||
}
|
||||
else if(issue_result > 0) {
|
||||
wsi->u.hdr.parser_state = WSI_TOKEN_SKIPPING;
|
||||
};
|
||||
};
|
||||
n = issue_char(wsi, c);
|
||||
if (n < 0)
|
||||
return -1;
|
||||
if (n > 0)
|
||||
wsi->u.hdr.parser_state = WSI_TOKEN_SKIPPING;
|
||||
|
||||
swallow:
|
||||
/* per-protocol end of headers management */
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue