[rabbitmq-discuss] Stomp frame not terminated with null character
Jonatan Kallus
jonatan at heysan.com
Thu Sep 18 19:32:09 BST 2008
I tested that, didn't work.
On Thu, Sep 18, 2008 at 11:28 AM, Tony Garnock-Jones <tonyg at lshift.net>wrote:
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080918/f456ac95/attachment.htm
More information about the rabbitmq-discuss
mailing list