File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
common/common-core/src/main/java/com/iohao/game/action/skeleton/eventbus
external/external-netty/src/main/java/com/iohao/game/external/core/netty/handler/check Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -86,4 +86,5 @@ docs.tar
8686hs_err_pid *
8787/target /
8888
89- doc_game.txt
89+ doc_game.txt
90+ .claude
Original file line number Diff line number Diff line change @@ -524,6 +524,10 @@ final class DefaultEventBus implements EventBus {
524524 this .id = Objects .requireNonNull (id );
525525 }
526526
527+ public void setBrokerClientContext (BrokerClientContext brokerClientContext ) {
528+ this .brokerClientContext = brokerClientContext ;
529+ }
530+
527531 @ Override
528532 public void register (Object eventBusSubscriber ) {
529533
Original file line number Diff line number Diff line change 2222import io .netty .channel .ChannelHandlerContext ;
2323import io .netty .channel .SimpleChannelInboundHandler ;
2424import io .netty .handler .codec .http .*;
25+ import io .netty .util .ReferenceCountUtil ;
2526
2627/**
2728 * @author 渔民小镇
@@ -33,11 +34,16 @@ public final class HttpFallbackHandler extends SimpleChannelInboundHandler<FullH
3334
3435 @ Override
3536 protected void channelRead0 (ChannelHandlerContext ctx , FullHttpRequest req ) {
36- // 检查是否是 WebSocket 升级请求
37- if ("websocket" .equalsIgnoreCase (req .headers ().get (HttpHeaderNames .UPGRADE ))) {
38- ctx .fireChannelRead (req .retain ());
39- } else {
40- ctx .close ();
37+ try {
38+ // 检查是否是 WebSocket 升级请求
39+ if ("websocket" .equalsIgnoreCase (req .headers ().get (HttpHeaderNames .UPGRADE ))) {
40+ ctx .fireChannelRead (req .retain ());
41+ } else {
42+ ctx .close ();
43+ }
44+ } finally {
45+ // 释放当前 handler 的引用
46+ ReferenceCountUtil .release (req );
4147 }
4248 }
4349
You can’t perform that action at this time.
0 commit comments