From 443a658af2d2d9e666c1f9ceffeffa65d5b3ca6d Mon Sep 17 00:00:00 2001 From: Kane York Date: Fri, 15 Sep 2017 13:58:13 -0700 Subject: [PATCH] Fix BunchedCommand replies --- socketserver/server/commands.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/socketserver/server/commands.go b/socketserver/server/commands.go index d585eb4c..3c5e55f3 100644 --- a/socketserver/server/commands.go +++ b/socketserver/server/commands.go @@ -461,17 +461,18 @@ func C2SHandleBunchedCommand(conn *websocket.Conn, client *ClientInfo, msg Clien client.MsgChannelKeepalive.Add(1) go func() { result := <-resultCh - var msg ClientMessage + var reply ClientMessage if result.Err != nil { - msg.Command = ErrorCommand - msg.Arguments = result.Err.Error() + reply.Command = ErrorCommand + reply.Arguments = result.Err.Error() } else { - msg.Command = SuccessCommand - msg.origArguments = result.Val.(string) - msg.parseOrigArguments() + reply.Command = SuccessCommand + reply.MessageID = msg.MessageID + reply.origArguments = result.Val.(string) + reply.parseOrigArguments() } - client.Send(msg) + client.Send(reply) client.MsgChannelKeepalive.Done() }()