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

Two consecutive emtpy messages confuse message size tracking #1042

Closed
0xabadea opened this issue Apr 24, 2013 · 2 comments
Closed

Two consecutive emtpy messages confuse message size tracking #1042

0xabadea opened this issue Apr 24, 2013 · 2 comments

Comments

@0xabadea
Copy link

When _trackMessageSize() is invoked with the first empty message, the while loop breaks immediately because message.length == 0. Then the "if (messages.length == 0" line after the while loop adds the message to response.partialMessage, so its value becomes "0<|msg|>" (the message delimiter is "<|msg|>" in wicket-atmosphere). The function returns true, so the message is not passed to callbacks.

When the function is invoked with the second empty message, the new message is appended to partialMessage, which now has the value "0<|msg|>0<|msg|>". This then confuses the substring-based parsing, which now only adds one empty message to the messages array, and this time the function returns false.

The point of this issue is that the first empty message should be delivered to callback immediately. If you're thinking "why are they sending empty messages", wicket-atmosphere does that. If sending empty messages in a bug in wicket-atmosphere (I believe it is), it is masked by this Atmosphere bug, or at least its first occurrence is.

@0xabadea
Copy link
Author

@jfarcand
Copy link
Member

Since the WICKET issue is fixed, closing this issue.

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

No branches or pull requests

2 participants