Consistently close connection after ERROR frame
Closes gh-23039
This commit is contained in:
parent
4f05da7fed
commit
d2ec876f57
|
|
@ -329,12 +329,10 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
|
|||
sendErrorMessage(session, ex);
|
||||
return;
|
||||
}
|
||||
|
||||
Message<byte[]> message = getErrorHandler().handleClientMessageProcessingError(clientMessage, ex);
|
||||
if (message == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
StompHeaderAccessor accessor = MessageHeaderAccessor.getAccessor(message, StompHeaderAccessor.class);
|
||||
Assert.state(accessor != null, "No StompHeaderAccessor");
|
||||
sendToClient(session, accessor, message.getPayload());
|
||||
|
|
@ -357,6 +355,14 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
|
|||
// Could be part of normal workflow (e.g. browser tab closed)
|
||||
logger.debug("Failed to send STOMP ERROR to client", ex);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
session.close(CloseStatus.PROTOCOL_ERROR);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean detectImmutableMessageInterceptor(MessageChannel channel) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue