Browse Source

Unwrap session before selecting stats counter

See gh-29375
pull/30101/head
rstoyanchev 2 years ago
parent
commit
5b67dea506
  1. 4
      spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java

4
spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2023 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.
@ -47,6 +47,7 @@ import org.springframework.web.socket.WebSocketMessage; @@ -47,6 +47,7 @@ import org.springframework.web.socket.WebSocketMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator;
import org.springframework.web.socket.handler.SessionLimitExceededException;
import org.springframework.web.socket.handler.WebSocketSessionDecorator;
import org.springframework.web.socket.sockjs.transport.session.PollingSockJsSession;
import org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession;
@ -669,6 +670,7 @@ public class SubProtocolWebSocketHandler @@ -669,6 +670,7 @@ public class SubProtocolWebSocketHandler
}
AtomicInteger getCountFor(WebSocketSession session) {
session = WebSocketSessionDecorator.unwrap(session);
if (session instanceof PollingSockJsSession) {
return this.httpPolling;
}

Loading…
Cancel
Save