SubProtocolWebSocketHandler checks if session is open
Issue: SPR-12812
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -264,6 +264,10 @@ public class SubProtocolWebSocketHandler implements WebSocketHandler,
|
||||
|
||||
@Override
|
||||
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
|
||||
// WebSocketHandlerDecorator could close the session
|
||||
if (!session.isOpen()) {
|
||||
return;
|
||||
}
|
||||
this.stats.incrementSessionCount(session);
|
||||
session = new ConcurrentWebSocketSessionDecorator(session, getSendTimeLimit(), getSendBufferSizeLimit());
|
||||
this.sessions.put(session.getId(), new WebSocketSessionHolder(session));
|
||||
|
||||
Reference in New Issue
Block a user