summaryrefslogtreecommitdiff
path: root/extlib/Stomp
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-09-15 17:08:27 -0400
committerEvan Prodromou <evan@status.net>2009-09-15 17:08:27 -0400
commit48565a2cdc9df329dee1ad327a1c632dd8f1d4c3 (patch)
tree6aae6d42475e94b8d9b2ab62db165295567dbeb0 /extlib/Stomp
parent80ba0603c65e1f2365f019128b656a042a2b82d0 (diff)
Revert "Several fixes to make RabbitMQ a player."
This reverts commit c04987018cd6c845c6da7a92d9857d8c651f7022.
Diffstat (limited to 'extlib/Stomp')
-rw-r--r--extlib/Stomp/Frame.php87
-rw-r--r--extlib/Stomp/Message.php6
2 files changed, 44 insertions, 49 deletions
diff --git a/extlib/Stomp/Frame.php b/extlib/Stomp/Frame.php
index 9fd97b4f5..dc59c1cb7 100644
--- a/extlib/Stomp/Frame.php
+++ b/extlib/Stomp/Frame.php
@@ -17,46 +17,46 @@
*/
/* vim: set expandtab tabstop=3 shiftwidth=3: */
-
-/**
- * Stomp Frames are messages that are sent and received on a StompConnection.
- *
- * @package Stomp
- * @author Hiram Chirino <hiram@hiramchirino.com>
- * @author Dejan Bosanac <dejan@nighttale.net>
- * @author Michael Caplan <mcaplan@labnet.net>
- * @version $Revision: 36 $
- */
-class Stomp_Frame
-{
- public $command;
- public $headers = array();
- public $body;
-
- /**
- * Constructor
- *
- * @param string $command
- * @param array $headers
- * @param string $body
- */
- public function __construct ($command = null, $headers = null, $body = null)
- {
- $this->_init($command, $headers, $body);
- }
-
- protected function _init ($command = null, $headers = null, $body = null)
- {
- $this->command = $command;
- if ($headers != null) {
- $this->headers = $headers;
- }
- $this->body = $body;
-
- if ($this->command == 'ERROR') {
- require_once 'Stomp/Exception.php';
- throw new Stomp_Exception($this->headers['message'], 0, $this->body);
- }
+
+/**
+ * Stomp Frames are messages that are sent and received on a StompConnection.
+ *
+ * @package Stomp
+ * @author Hiram Chirino <hiram@hiramchirino.com>
+ * @author Dejan Bosanac <dejan@nighttale.net>
+ * @author Michael Caplan <mcaplan@labnet.net>
+ * @version $Revision: 36 $
+ */
+class Stomp_Frame
+{
+ public $command;
+ public $headers = array();
+ public $body;
+
+ /**
+ * Constructor
+ *
+ * @param string $command
+ * @param array $headers
+ * @param string $body
+ */
+ public function __construct ($command = null, $headers = null, $body = null)
+ {
+ $this->_init($command, $headers, $body);
+ }
+
+ protected function _init ($command = null, $headers = null, $body = null)
+ {
+ $this->command = $command;
+ if ($headers != null) {
+ $this->headers = $headers;
+ }
+ $this->body = $body;
+
+ if ($this->command == 'ERROR') {
+ require_once 'Stomp/Exception.php';
+ throw new Stomp_Exception($this->headers['message'], 0, $this->body);
+ }
}
/**
@@ -74,8 +74,7 @@ class Stomp_Frame
$data .= "\n";
$data .= $this->body;
- $data .= "\x00\n"; // Should there really be a linefeed here?
- return $data;
- }
-}
+ return $data .= "\x00\n";
+ }
+}
?> \ No newline at end of file
diff --git a/extlib/Stomp/Message.php b/extlib/Stomp/Message.php
index 055662133..6bcad3efd 100644
--- a/extlib/Stomp/Message.php
+++ b/extlib/Stomp/Message.php
@@ -29,12 +29,8 @@ require_once 'Stomp/Frame.php';
*/
class Stomp_Message extends Stomp_Frame
{
- public function __construct ($body, $headers = array())
+ public function __construct ($body, $headers = null)
{
- if(!isset($headers['content-length'])) {
- // TODO: log this, to see if this is correct
- $headers['content-length'] = strlen($body);
- }
$this->_init("SEND", $headers, $body);
}
}