Merge pull request #11086 from jetty/jetty-12.0.x-11081-websocketRace

Issue #11081 - fix race condition in WebSocket FrameHandlers (jetty-12)
This commit is contained in:
Simone Bordet 2023-12-29 14:44:58 +01:00 committed by GitHub
commit 2505d0e8a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -389,9 +389,10 @@ public class JettyWebSocketFrameHandler implements FrameHandler
}
// Accept the payload into the message sink.
activeMessageSink.accept(frame, callback);
MessageSink messageSink = activeMessageSink;
if (frame.isFin())
activeMessageSink = null;
messageSink.accept(frame, callback);
}
boolean isAutoDemand()

View File

@ -583,9 +583,10 @@ public class JakartaWebSocketFrameHandler implements FrameHandler
}
// Accept the payload into the message sink
activeMessageSink.accept(frame, callback);
MessageSink messageSink = activeMessageSink;
if (frame.isFin())
activeMessageSink = null;
messageSink.accept(frame, callback);
}
public void onPing(Frame frame, Callback callback)

View File

@ -590,9 +590,10 @@ public class JakartaWebSocketFrameHandler implements FrameHandler
}
// Accept the payload into the message sink
activeMessageSink.accept(frame, callback);
MessageSink messageSink = activeMessageSink;
if (frame.isFin())
activeMessageSink = null;
messageSink.accept(frame, callback);
}
public void onPing(Frame frame, Callback callback)

View File

@ -329,9 +329,10 @@ public class JettyWebSocketFrameHandler implements FrameHandler
}
// Accept the payload into the message sink
activeMessageSink.accept(frame, callback);
MessageSink messageSink = activeMessageSink;
if (frame.isFin())
activeMessageSink = null;
messageSink.accept(frame, callback);
}
private void onBinaryFrame(Frame frame, Callback callback)