[rabbitmq-discuss] Stomp frame not terminated with null character
Tony Garnock-Jones
tonyg at lshift.net
Thu Sep 18 19:28:53 BST 2008
Hi again,
Jonatan Kallus wrote:
> As an aside, on re-reading the protocol, I'm wondering if our scan for
> end of frame is incorrect (or specific to ActiveMQ's implementation). A
> frame is terminated by a \x00, and not \x00 + \n according to the spec:
>
> "...the null indicates the end of the frame."
This could well be it. Looking at readFrame from Stomp.php:
do {
$read = fgets($this->_socket, $rb);
if ($read === false) {
$this->_reconnect();
return $this->readFrame();
}
$data .= $read;
$len = strlen($data);
} while (($len < 2 || ! ($data[$len - 2] == "\x00" && $data[$len - 1]
== "\n")));
Did you try changing that last line to something like
($len < 1 || $data[$len - 1] != "\x00");
?
Tony
More information about the rabbitmq-discuss
mailing list