From bd2edf26dfbba7a0ed3b7f31af004ee071d3feb1 Mon Sep 17 00:00:00 2001 From: Mattison chao <74767115+mattisonchao@users.noreply.github.com> Date: Mon, 4 Jan 2021 16:00:51 +0800 Subject: [PATCH] Fix implementation of isOpen() in ReactorNettyWebSocketSession See gh-26332 for details. Closes gh-26341 --- .../socket/adapter/ReactorNettyWebSocketSession.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java index ab58f6f1af..12d04654d1 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.web.reactive.socket.adapter; import java.util.function.Consumer; @@ -33,7 +34,6 @@ import org.springframework.web.reactive.socket.HandshakeInfo; import org.springframework.web.reactive.socket.WebSocketMessage; import org.springframework.web.reactive.socket.WebSocketSession; - /** * {@link WebSocketSession} implementation for use with the Reactor Netty's * {@link NettyInbound} and {@link NettyOutbound}. @@ -100,7 +100,7 @@ public class ReactorNettyWebSocketSession public boolean isOpen() { DisposedCallback callback = new DisposedCallback(); getDelegate().getInbound().withConnection(callback); - return callback.isDisposed(); + return !callback.isDisposed(); } @Override