-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Issue #5368 - ensure onMessage exits before next frame is read #5377
Issue #5368 - ensure onMessage exits before next frame is read #5377
Conversation
Signed-off-by: Lachlan Roberts <[email protected]>
Relying on exit/return from the Example: We get a TEXT Message as series of frames. |
@joakime we do need to pay attention to the exit for the I'm not opposed to putting a warning if we end up discarding content, but I feel like it would be excessive to warn once per frame, once per message seems fine. But I don't think its a good idea to be extra-harsh and terminate the connection. This could be a breaking change for people relying on the discard behavior. |
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have questions / concerns...
...ommon/src/main/java/org/eclipse/jetty/websocket/common/events/JettyAnnotatedEventDriver.java
Show resolved
Hide resolved
...-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/endpoints/JsrEndpointEventDriver.java
Show resolved
Hide resolved
...impl/src/main/java/org/eclipse/jetty/websocket/jsr356/endpoints/JsrAnnotatedEventDriver.java
Show resolved
Hide resolved
...ommon/src/main/java/org/eclipse/jetty/websocket/common/events/JettyAnnotatedEventDriver.java
Show resolved
Hide resolved
...-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java
Show resolved
Hide resolved
...cket-common/src/main/java/org/eclipse/jetty/websocket/common/message/MessageInputStream.java
Show resolved
Hide resolved
...cket-common/src/main/java/org/eclipse/jetty/websocket/common/message/MessageInputStream.java
Show resolved
Hide resolved
...cket-common/src/main/java/org/eclipse/jetty/websocket/common/message/MessageInputStream.java
Outdated
Show resolved
Hide resolved
...cket-common/src/main/java/org/eclipse/jetty/websocket/common/message/MessageInputStream.java
Outdated
Show resolved
Hide resolved
...cket-common/src/main/java/org/eclipse/jetty/websocket/common/message/MessageInputStream.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the CI build is green, go ahead and merge.
Issue #5368
When reading a websocket message with a
Reader
orInputStream
ensure that theonMessage()
method has exited before resuming to read and parse websocket frames. Otherwise a call to theMessageInputStream.read()
orMessageInputStream.close()
could parse the next websocket frame which could trigger a second nested call toonMessage()
in the same thread.