Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Weheartwebsites/SOCKS5/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ public function recv($length)
$buffer = @fread($this->socket, $length - mb_strlen($result, 'ASCII'));

// If the buffer actually contains something then add it to the result
if ($buffer !== false) {
// Note that fread() will return '' (empty string) when a timeout occurs unlike socket_read() which returns false...
// https://www.php.net/manual/zh/function.fread.php#115340
if ($buffer !== "") {

$result .= $buffer;

Expand Down Expand Up @@ -393,4 +395,4 @@ private function negotiate()
// run login
return $this->methods[$response['method']]->authenticate($this);
}
}
}