Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use fgets instead of fread in Stomp::readFrame()

fread reads up to specified number of bytes or EOF.
fgets reads up to "\n", number of bytes or EOF.

The problem with fread is that if there is more than one Frame
on the socket, it will read the current Frame and part of the next
Frame.  Stomp::readFrame() is expected to just read the next Frame.
  • Loading branch information...
commit e143d5c40b930935cf8a72da9e0a4419bc02a217 1 parent 92265d5
@boonedox boonedox authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/FuseSource/Stomp/Stomp.php
View
2  src/FuseSource/Stomp/Stomp.php
@@ -563,7 +563,7 @@ public function readFrame ()
$end = false;
do {
- $read = fread($this->_socket, $rb);
+ $read = fgets($this->_socket, $rb);
if ($read === false || $read === "") {
$this->_reconnect();
return $this->readFrame();

0 comments on commit e143d5c

Please sign in to comment.
Something went wrong with that request. Please try again.