From a566b99e98cc6fa6ee648fad0d20af3aaf8dbf78 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Tue, 21 Apr 2026 17:33:11 +0800 Subject: [PATCH] fix protocol --- include/protocol.hrl | 4 ++-- src/transport/tcp/ssl_channel.erl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/protocol.hrl b/include/protocol.hrl index e3e6a5b..daab48e 100644 --- a/include/protocol.hrl +++ b/include/protocol.hrl @@ -9,10 +9,10 @@ %% 一级帧类型 %% REQUEST: 需要响应的请求帧 -%% RESPONSE: 对 REQUEST 的响应帧 +%% REPLY: 对 REQUEST 的响应帧 %% CAST: 单向消息帧,不需要响应 -define(FRAME_REQUEST, 16#01). --define(FRAME_RESPONSE, 16#02). +-define(FRAME_REPLY, 16#02). -define(FRAME_CAST, 16#03). %%%% 命令类型子分类, 不需要返回值 diff --git a/src/transport/tcp/ssl_channel.erl b/src/transport/tcp/ssl_channel.erl index 359f00a..6ea1bc7 100644 --- a/src/transport/tcp/ssl_channel.erl +++ b/src/transport/tcp/ssl_channel.erl @@ -174,7 +174,7 @@ handle_info({ssl, Socket, <>}, CastFrame = message_pb:decode_msg(FrameBin, 'CastFrame'), handle_cast_frame(CastFrame, HostPid, State); -handle_info({ssl, Socket, <>}, +handle_info({ssl, Socket, <>}, State = #state{socket = Socket, inflight = Inflight}) -> ReplyFrame = message_pb:decode_msg(FrameBin, 'ReplyFrame'), handle_reply_frame(ReplyFrame, Inflight, State); @@ -317,4 +317,4 @@ handle_reply_frame(#'ReplyFrame'{packet_id = PacketId, reply = Reply}, _Inflight -spec send_reply_frame(module(), any(), non_neg_integer(), tuple()) -> any(). send_reply_frame(Transport, Socket, PacketId, Reply) -> Encoded = message_pb:encode_msg(#'ReplyFrame'{packet_id = PacketId, reply = Reply}), - Transport:send(Socket, <>). + Transport:send(Socket, <>).