Skip to content

Commit

Permalink
[hl] Ignore WANT_READ/WANT_WRITE errors when the socket is known to b…
Browse files Browse the repository at this point in the history
…e blocking. (#11655)
  • Loading branch information
Apprentice-Alchemist authored Jul 25, 2024
1 parent 1c71a0e commit 8149e5e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions std/hl/_std/sys/ssl/Socket.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ private class SocketInput extends haxe.io.Input {
__s.handshake();
var r = @:privateAccess __s.ssl.recv(buf, pos, len);
if (r == -1)
throw haxe.io.Error.Blocked;
if (@:privateAccess __s.isBlocking)
return 0
else
throw haxe.io.Error.Blocked;
else if (r <= 0)
throw new haxe.io.Eof();
return r;
Expand Down Expand Up @@ -85,7 +88,10 @@ private class SocketOutput extends haxe.io.Output {
__s.handshake();
var r = @:privateAccess __s.ssl.send(buf, pos, len);
if (r == -1)
throw haxe.io.Error.Blocked;
if (@:privateAccess __s.isBlocking)
return 0
else
throw haxe.io.Error.Blocked;
else if (r < 0)
throw new haxe.io.Eof();
return r;
Expand Down

0 comments on commit 8149e5e

Please sign in to comment.