Merge pull request #160 from granolamatt/master

Fixed websocket not reading multiple messages in one packet
master
Nicolas Favre-Felix 5 years ago committed by GitHub
commit 1fe10288e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -310,7 +310,7 @@ ws_add_data(struct http_client *c) {
state = ws_parse_data(c->buffer, c->sz, &c->frame); state = ws_parse_data(c->buffer, c->sz, &c->frame);
if(state == WS_MSG_COMPLETE) { while(state == WS_MSG_COMPLETE) {
int ret = ws_execute(c, c->frame->payload, c->frame->payload_sz); int ret = ws_execute(c, c->frame->payload, c->frame->payload_sz);
/* remove frame from client buffer */ /* remove frame from client buffer */
@ -323,6 +323,7 @@ ws_add_data(struct http_client *c) {
/* can't process frame. */ /* can't process frame. */
return WS_ERROR; return WS_ERROR;
} }
state = ws_parse_data(c->buffer, c->sz, &c->frame);
} }
return state; return state;
} }

Loading…
Cancel
Save