mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
client: fix verification of the accepted protocol
to properly take ", *" as delimiter Signed-off-by: Alejandro Mery <amery@geeks.cl>
This commit is contained in:
parent
72d5c584e1
commit
31f9eeb9d6
1 changed files with 4 additions and 4 deletions
|
@ -562,13 +562,13 @@ lws_client_interpret_server_handshake(struct libwebsocket_context *context,
|
|||
|
||||
while (pc && *pc && !okay) {
|
||||
if (!strncmp(pc, p, len) &&
|
||||
(pc[len] == ',' || pc[len] == '\0')) {
|
||||
(pc[len] == ',' || pc[len] == '\0')) {
|
||||
okay = 1;
|
||||
continue;
|
||||
}
|
||||
while (*pc && *pc != ',')
|
||||
pc++;
|
||||
while (*pc && *pc != ' ')
|
||||
while (*pc && *pc++ != ',')
|
||||
;
|
||||
while (*pc && *pc == ' ')
|
||||
pc++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue