Skip to content

Commit 59746fb

Browse files
Improved check of fwrite result
1 parent 4173007 commit 59746fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/connection/StreamSocket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function write(string $buffer): void
7575
while (0 < $size) {
7676
$sent = fwrite($this->stream, $buffer);
7777

78-
if ($sent === false) {
78+
if ($sent === false || $sent === 0) {
7979
if (microtime(true) - $time >= $this->timeout)
8080
throw new ConnectionTimeoutException('Connection timeout reached after ' . $this->timeout . ' seconds.');
8181
else

0 commit comments

Comments
 (0)