-
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
prevent multiple demand in websocket-core #9982
prevent multiple demand in websocket-core #9982
Conversation
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
...ebsocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketConnection.java
Outdated
Show resolved
Hide resolved
...ebsocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketConnection.java
Outdated
Show resolved
Hide resolved
...socket-core-common/src/main/java/org/eclipse/jetty/websocket/core/util/DemandingFlusher.java
Outdated
Show resolved
Hide resolved
...socket-core-common/src/main/java/org/eclipse/jetty/websocket/core/util/DemandingFlusher.java
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
return; | ||
|
||
demand = MathUtils.cappedAdd(demand, 1); | ||
if (demand != null) |
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.
demand != CANCELLED
instead?
if (demand > 0) | ||
demand--; | ||
|
||
if (demand != null) |
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.
demand != CANCELLED
instead?
@@ -415,7 +432,7 @@ public void cancelDemand() | |||
{ | |||
if (LOG.isDebugEnabled()) | |||
LOG.debug("cancelDemand d={} fp={} {} {}", demand, fillingAndParsing, networkBuffer, this); | |||
demand = -1; | |||
demand = null; |
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.
demand = CANCELLED
instead?
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
private enum DemandState | ||
{ | ||
DEMANDING, | ||
NOT_DEMANDING, |
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.
IDLE
would also be OK.
closes #9965