Skip to content
Snippets Groups Projects
Commit 0ea1ce1d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use socket.poll() to check socket for writability before send()

This is the real fix for infinite-wait on send() problem that was attempted
in commit f0127e9d, but caused other issues. Thanks Deuce.
parent c3a41492
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3407 passed
......@@ -249,6 +249,10 @@ BinkP.prototype.send_chunks = function(str) {
var sent = 0;
while (sent < str.length) {
if (this.sock.poll(this.timeout, /* write: */true) == 0) {
log(LOG_WARNING, "TIMEOUT of socket poll() for write");
return false;
}
ret = this.sock.send(str.substr(sent));
if (ret > 0)
sent += ret;
......
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