From a3550e9b418ded20500d9f06555fa128f2909d7d Mon Sep 17 00:00:00 2001 From: Camron Levanger Date: Fri, 12 Sep 2014 17:01:52 -0600 Subject: [PATCH 1/2] added idea project files to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 46422e3..0fcb3c9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ nbproject composer.lock composer.phar vendor +/.idea From 8bca4a55b5db8493f543c7f2d1db13d42455e19d Mon Sep 17 00:00:00 2001 From: Camron Levanger Date: Fri, 12 Sep 2014 17:02:05 -0600 Subject: [PATCH 2/2] The readFrame() method in Stomp.php was not compatible with RabbitMQ and possibly other STOMP servers. It worked with Apollo since Apollo always sends a newline after the null character. The STOMPspecification only calls for a null character as termination, so I have updated the readFrame() method to read a character at a 17:04off of the socket. This way the library supports only a nullcharacter as termination, but still handles multiple frames onthe socket without having to implement a buffer for overreads. --- src/FuseSource/Stomp/Stomp.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/FuseSource/Stomp/Stomp.php b/src/FuseSource/Stomp/Stomp.php index 29491e7..2759981 100755 --- a/src/FuseSource/Stomp/Stomp.php +++ b/src/FuseSource/Stomp/Stomp.php @@ -341,7 +341,7 @@ public function subscribe ($destination, $properties = null, $sync = null) } else if ($this->brokerVendor == 'RMQ') { $headers['prefetch-count'] = $this->prefetchSize; } - + if ($this->clientId != null) { if ($this->brokerVendor == 'AMQ') { $headers['activemq.subscriptionName'] = $this->clientId; @@ -558,12 +558,11 @@ public function readFrame () return false; } - $rb = 1024; $data = ''; $end = false; do { - $read = fgets($this->_socket, $rb); + $read = fgetc($this->_socket); if ($read === false || $read === "") { $this->_reconnect(); return $this->readFrame();