Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

pipelined frames do not work #46

Open
teknopaul opened this issue Apr 15, 2017 · 0 comments
Open

pipelined frames do not work #46

teknopaul opened this issue Apr 15, 2017 · 0 comments

Comments

@teknopaul
Copy link

The on('data') handler has apparent spec violation and subsequent fix that introduces a regression.

The body is then followed by the NULL octet. The examples in this document will use ^@, control-@ in ASCII, to represent the NULL octet. The NULL octet can be optionally followed by multiple EOLs.

    var frames = buffer.split('\0\n'); 

A fix was added that breaks pipelined frames, if frames arrive with mixed \0 and \0\n

    // Temporary fix : NULL,LF is not a guranteed standard, the LF is optional, so lets deal with it.  (Rauls)
    if (frames.length == 1) {  // N.B. == 1means only it the previous split did nothing.
        frames = buffer.split('\0');
    }

Side note: \0 is valid inside MESSAGE data if content-length was provided. But I guess thats a bigger issue.Its OK thatn stomp.js does not support binary. Should be in the docs tho.

I think just

var frames = buffer.split('\0');

Should suffice, I tested that and it seems OK.

Mixed \0 and \0\n terminations occur when \n heartbeats are added between frames that then get buffered.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant