Skip to content
Snippets Groups Projects
Commit ff056974 authored by zuul's avatar zuul Committed by Gerrit Code Review
Browse files

Merge "res_http_websocket: Fix faulty read logic."

parents 9cd1a754 5d0371d7
No related branches found
No related tags found
No related merge requests found
......@@ -529,10 +529,12 @@ static inline int ws_safe_read(struct ast_websocket *session, char *buf, int len
return -1;
}
}
xlen = xlen - rlen;
rbuf = rbuf + rlen;
if (!xlen) {
break;
if (rlen > 0) {
xlen = xlen - rlen;
rbuf = rbuf + rlen;
if (!xlen) {
break;
}
}
if (ast_wait_for_input(ast_iostream_get_fd(session->stream), 1000) < 0) {
ast_log(LOG_ERROR, "ast_wait_for_input returned err: %s\n", strerror(errno));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment