Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sends multiple CONNECT frames then crashes if 1.2 CONNECTED doesn't include optional session and server headers #179

Open
EvelynSubarrow opened this issue Nov 4, 2023 · 3 comments

Comments

@EvelynSubarrow
Copy link

If selenetherium doesn't supply session and server headers in its CONNECTED frame:

CONNECT
accept-version:1.0,1.1,1.2
host:192.168.0.59
heart-beat:0,0

^ CONNECTED
version:1.2

^ CONNECT
accept-version:1.0,1.1,1.2
host:192.168.0.59
heart-beat:0,0

^ CONNECTED
version:1.2

^ SUBSCRIBE
destination:test_queue
ack:client
id:6250520166077902233
selector:test_queue_placeholder
activemq.prefetchSize:1
receipt:71806d91e413075ecdc5c1b7debb029b
[...]

It emits a few more CONNECT frames interspersed with normal operation before eventually crashing with the error message Unexpected response received. Expected a "CONNECTED" Frame to determine Version. Got a "Message" Frame

If session and server headers are supplied, this behaviour isn't exhibited, and it works fine.

CONNECT
accept-version:1.0,1.1,1.2
host:192.168.0.59
heart-beat:0,0

^ CONNECTED
version:1.2
session:placeholder
server:Selenetherium/0.0.0

^ SUBSCRIBE
destination:test_queue
ack:client
id:4903425750406440245
selector:test_queue_placeholder
receipt:f8525dfa0c1d83b28066280b483a4449
[...]

session is ambiguously defined in 1.0, it could be interpreted as being required, but in all future versions, all headers except version are optional in CONNECTED.

@whikloj
Copy link
Collaborator

whikloj commented Nov 8, 2023

Hi @EvelynSubarrow,

I don't know what selenetherium is, is that a client or server built using stomp-php? Just trying to understand the issue here and on what side stomp-php is on.

@EvelynSubarrow
Copy link
Author

Hi @whikloj, not the clearest explanation on my part, selenetherium is a server. In the logs, all client frames came from stomp-php, and all server frames from selenetherium. I wrote Selenetherium as a client tester to help me build a list of compatible STOMP clients on the NROD wiki.

To describe the bug here more (hopefully) more exactly, stomp-php expects a CONNECTED frame from a broker to have server and session headers under STOMP 1.1, even though only version is actually required.

https://wiki.openraildata.com/index.php?title=List_of_STOMP_Client_Libraries
https://codeberg.org/Subarrow/Selenetherium

@whikloj
Copy link
Collaborator

whikloj commented Nov 10, 2023

This may be helpful as there are parts of this codebase that are less clear to me. So I'm compiling selenetherium, but as I'm not an Erlang developer can you tell me how to get it running and if it is possible to limit the tests run to specific ones?

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

No branches or pull requests

2 participants