diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index be3053e6a..4368c066a 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -214,23 +214,26 @@ func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { } rtcClient := pbRtc.NewRtcServiceClient(connGrpc) req := &pbRtc.SignalMessageAssembleReq{ - SignalReq: pData.(*pbRtc.SignalReq), + SignalReq: pData.(*pbRtc.SignalReq), + OperationID: m.OperationID, } respPb, err := rtcClient.SignalMessageAssemble(context.Background(), req) if err != nil { - log.NewError(m.OperationID, utils.GetSelfFuncName(), "SignalMessageAssemble", err.Error()) + log.NewError(m.OperationID, utils.GetSelfFuncName(), "SignalMessageAssemble", err.Error(), config.Config.Rtc.Address+":"+strconv.Itoa(config.Config.Rtc.Port)) ws.sendSignalMsgResp(conn, 204, "grpc SignalMessageAssemble failed: "+err.Error(), m, &signalResp) return } signalResp.Payload = respPb.SignalResp.Payload - msgData := &sdk_ws.MsgData{} - utils.CopyStructFields(msgData, respPb.MsgData) + msgData := sdk_ws.MsgData{} + utils.CopyStructFields(&msgData, respPb.MsgData) + log.NewInfo(m.OperationID, utils.GetSelfFuncName(), respPb.String()) if respPb.IsPass { pbData := pbChat.SendMsgReq{ Token: m.Token, OperationID: m.OperationID, - MsgData: msgData, + MsgData: &msgData, } + log.NewInfo(m.OperationID, utils.GetSelfFuncName(), "pbData: ", pbData) log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, msgData) etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) client := pbChat.NewChatClient(etcdConn) diff --git a/internal/msg_gateway/gate/validate.go b/internal/msg_gateway/gate/validate.go index d34883c5c..329f93655 100644 --- a/internal/msg_gateway/gate/validate.go +++ b/internal/msg_gateway/gate/validate.go @@ -9,6 +9,7 @@ package gate import ( "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" + pbRtc "Open_IM/pkg/proto/rtc" open_im_sdk "Open_IM/pkg/proto/sdk_ws" "github.com/golang/protobuf/proto" ) @@ -71,7 +72,7 @@ func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, er } return true, 0, "", data case constant.WSSendSignalMsg: - data := open_im_sdk.SignalReq{} + data := pbRtc.SignalReq{} if err := proto.Unmarshal(m.Data, &data); err != nil { log.ErrorByKv("Decode Data struct err", "", "err", err.Error(), "reqIdentifier", r) return false, 203, err.Error(), nil diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index d93385632..3c597fbbf 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -378,7 +378,7 @@ type config struct { } } Rtc struct { - Port int `yaml:"rtcPort"` + Port int `yaml:"port"` Address string `yaml:"address"` } `yaml:"rtc"` } diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index 1f9cb5bb1..12ff7b15d 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -506,7 +506,7 @@ message DelMsgListReq{ } message DelMsgListResp{ - int32 errCode = 1; + int32 errCode = 1; string errMsg = 2; } diff --git a/script/env_check.sh b/script/env_check.sh index a3a9857f6..2d81390f7 100644 --- a/script/env_check.sh +++ b/script/env_check.sh @@ -1,12 +1,36 @@ #!/usr/bin/env bash source ./style_info.cfg -echo -e "check environment......................................." +echo -e "check login user........................................" +user=`whoami` +if [ $user == "root" ] ; then + echo -e ${GREEN_PREFIX} "ok: login user is root" ${COLOR_SUFFIX} +else + echo -e ${RED_PREFIX}"Warning: The current user is not root "${COLOR_SUFFIX} +fi + + + +echo -e "check docker............................................" +docker_running=`systemctl status docker | grep running | grep active | wc -l` + +docker_version=`docker-compose -v; docker -v` + +if [ $docker_running -gt 0 ]; then + echo -e ${GREEN_PREFIX} "ok: docker is running" ${COLOR_SUFFIX} + echo -e ${GREEN_PREFIX} $docker_version ${COLOR_SUFFIX} + +else + echo -e ${RED_PREFIX}"docker not running"${COLOR_SUFFIX} +fi + + +echo -e "check environment......................................." SYSTEM=`uname -s` if [ $SYSTEM != "Linux" ] ; then echo -e ${RED_PREFIX}"Warning: Currently only Linux is supported"${COLOR_SUFFIX} else - echo -e ${GREEN_PREFIX} "Linux system is ok"${COLOR_SUFFIX} + echo -e ${GREEN_PREFIX} "ok: system is linux"${COLOR_SUFFIX} fi echo -e "check memory............................................" @@ -15,5 +39,5 @@ if [ $available -lt 2000 ] ; then echo -e ${RED_PREFIX}"Warning: Your memory not enough, available is: " "$available"m${COLOR_SUFFIX}"\c" echo -e ${RED_PREFIX}", must be greater than 2000m"${COLOR_SUFFIX} else - echo -e ${GREEN_PREFIX} "Memory is ok, available is: "$available"m${COLOR_SUFFIX}" + echo -e ${GREEN_PREFIX} "ok: available memory is: "$available"m${COLOR_SUFFIX}" fi