Skip to content

Commit

Permalink
Removed previously commented "multiple sending attempts" code;
Browse files Browse the repository at this point in the history
More doc fixes.
  • Loading branch information
boenrobot committed Apr 29, 2017
1 parent f1e6fe7 commit 500e931
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/PEAR2/Net/Transmitter/NetworkStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function setCrypto($type)
*/
public function isAvailable()
{
if (parent::isStream($this->stream)) {
if ($this->isStream($this->stream)) {
if ($this->isBlocking && feof($this->stream)) {
return false;
}
Expand Down
17 changes: 7 additions & 10 deletions src/PEAR2/Net/Transmitter/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Stream
*
* Key is the direction, value is the size in bytes as integer.
*
* @var array
* @var array<int,int>
*/
protected $chunkSize = array(
self::DIRECTION_SEND => 0xFFFFF, self::DIRECTION_RECEIVE => 0xFFFFF
Expand Down Expand Up @@ -316,7 +316,6 @@ public function getChunk($direction = self::DIRECTION_ALL)
public function send($contents, $offset = null, $length = null)
{
$bytes = 0;
$fails = 0;
$chunkSize = $this->chunkSize[self::DIRECTION_SEND];
$lengthIsNotNull = null !== $length;
$offsetIsNotNull = null !== $offset;
Expand All @@ -340,14 +339,12 @@ public function send($contents, $offset = null, $length = null)
if (0 != $bytesNow) {
$bytes += $bytesNow;
} elseif ($this->isBlocking || false === $bytesNow) {
//if (1 < ++$fails) {
throw $this->createException(
'Failed while sending stream.',
2,
null,
$bytes
);
//}
throw $this->createException(
'Failed while sending stream.',
2,
null,
$bytes
);
}
}
$this->isAcceptingData(null);
Expand Down

0 comments on commit 500e931

Please sign in to comment.