fix
This commit is contained in:
parent
2166510989
commit
8f8e813a8c
@ -85,7 +85,7 @@ handle_info({timeout, _, create_transport}, State = #state{}) ->
|
|||||||
{ok, TransportPid} ->
|
{ok, TransportPid} ->
|
||||||
Ref = efka_transport:auth_request(TransportPid, 5000),
|
Ref = efka_transport:auth_request(TransportPid, 5000),
|
||||||
receive
|
receive
|
||||||
%% 验证通过
|
%% 验证通过
|
||||||
{auth_reply, Ref, {ok, #auth_reply{code = 1, message = Message, repository_url = RepositoryUrl}}} ->
|
{auth_reply, Ref, {ok, #auth_reply{code = 1, message = Message, repository_url = RepositoryUrl}}} ->
|
||||||
lager:debug("[efka_agent] auth result: ~p, repository_url: ~p", [Message, RepositoryUrl]),
|
lager:debug("[efka_agent] auth result: ~p, repository_url: ~p", [Message, RepositoryUrl]),
|
||||||
{noreply, State#state{transport_pid = TransportPid, status = ?STATE_ACTIVATED}};
|
{noreply, State#state{transport_pid = TransportPid, status = ?STATE_ACTIVATED}};
|
||||||
|
|||||||
@ -120,12 +120,11 @@ handle_cast({auth_request, ReceiverPid, Ref, Timeout}, State = #state{socket = S
|
|||||||
%% 需要等待auth返回的结果
|
%% 需要等待auth返回的结果
|
||||||
receive
|
receive
|
||||||
{ssl, Socket, <<?PACKET_RESPONSE, PacketId:32, ?METHOD_AUTH, ReplyBin/binary>>} ->
|
{ssl, Socket, <<?PACKET_RESPONSE, PacketId:32, ?METHOD_AUTH, ReplyBin/binary>>} ->
|
||||||
lager:debug("call me here auth reply"),
|
|
||||||
ReceiverPid ! {auth_reply, Ref, {ok, message_pb:decode_msg(ReplyBin, auth_reply)}},
|
ReceiverPid ! {auth_reply, Ref, {ok, message_pb:decode_msg(ReplyBin, auth_reply)}},
|
||||||
{noreply, State#state{packet_id = PacketId + 1}}
|
{noreply, State#state{packet_id = PacketId + 1}}
|
||||||
after Timeout ->
|
after Timeout ->
|
||||||
ReceiverPid ! {auth_reply, Ref, {error, timeout}},
|
ReceiverPid ! {auth_reply, Ref, {error, timeout}},
|
||||||
{noreply, State}
|
{stop, normal, State}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
handle_cast({send, Method, Packet}, State = #state{socket = Socket}) ->
|
handle_cast({send, Method, Packet}, State = #state{socket = Socket}) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user