Skip to content
Snippets Groups Projects
Commit efc04997 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 2cddddce, but caused other issues. Thanks Deuce.
parent cf235049
No related branches found
No related tags found
No related merge requests found
......@@ -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