mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-18 17:35:04 -07:00
Merge "res_http_websocket: Fix faulty read logic."
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user