1
0
Fork 0
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:
Alejandro Mery 2014-12-10 16:32:44 +01:00 committed by Andy Green
parent 72d5c584e1
commit 31f9eeb9d6

View file

@ -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++;
}