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

prevent multiple demand in websocket-core #9982

Merged

Conversation

lachlan-roberts
Copy link
Contributor

closes #9965

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Base automatically changed from jetty-12.0.x-WebSocketDemand to jetty-12.0.x June 28, 2023 21:53
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
return;

demand = MathUtils.cappedAdd(demand, 1);
if (demand != null)
Copy link
Contributor

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)
Copy link
Contributor

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;
Copy link
Contributor

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,
Copy link
Contributor

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.

@lachlan-roberts lachlan-roberts merged commit 93a5726 into jetty-12.0.x Jun 30, 2023
@lachlan-roberts lachlan-roberts deleted the jetty-12.0.x-9965-fixDemandImplementation branch June 30, 2023 02:55
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

Successfully merging this pull request may close these issues.

3 participants