Skip to content

Commit

Permalink
Fix iOS getFile bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
wubenqi committed Dec 26, 2018
1 parent 729ab84 commit bf20f76
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions access/session/server/download_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
package server

import (
"github.com/nebula-chat/chatengine/mtproto/rpc"
"github.com/golang/glog"
"github.com/nebula-chat/chatengine/mtproto"
"github.com/nebula-chat/chatengine/mtproto/rpc"
"github.com/nebula-chat/chatengine/pkg/grpc_util"
"github.com/golang/glog"
"reflect"
"time"
)
Expand All @@ -42,7 +42,19 @@ func (c *downloadSession) onMessageData(id ClientConnID, cntl *zrpc.ZRpcControll
reflect.TypeOf(sessMsg.Object))

// TODO(@benqi): sync AuthUserId??
requestMessage := sessMsg
var requestMessage *mtproto.TLMessage2

switch sessMsg.Object.(type) {
case *TLInvokeWithoutUpdatesExt:
invokeWithoutUpdatesExt, _ := sessMsg.Object.(*TLInvokeWithoutUpdatesExt)
requestMessage = &mtproto.TLMessage2{
MsgId: sessMsg.MsgId,
Seqno: sessMsg.Seqno,
Object: invokeWithoutUpdatesExt.Query,
}
default:
requestMessage = sessMsg
}

// reqMsgId := msgId
for e := c.apiMessages.Front(); e != nil; e = e.Next() {
Expand Down Expand Up @@ -82,7 +94,7 @@ func (c *downloadSession) onInvokeRpcRequest(authUserId int32, authKeyId int64,
glog.Infof("downloadSession]]>> onInvokeRpcRequest - receive data: {sess: %s, session_id: %d, conn_id: %d, md: %s, data: {%v}}",
c, requests.sessionId, requests.connID, requests.cntl, requests.rpcMessages)

return invokeRpcRequest(authUserId, authKeyId, layer, requests, func() *grpc_util.RPCClient{ return c.RPCClient })
return invokeRpcRequest(authUserId, authKeyId, layer, requests, func() *grpc_util.RPCClient { return c.RPCClient })
}

func (c *downloadSession) onRpcResult(rpcResults *rpcApiMessages) {
Expand All @@ -97,4 +109,3 @@ func (c *downloadSession) onRpcResult(rpcResults *rpcApiMessages) {
c.sendPendingMessagesToClient(rpcResults.connID, rpcResults.cntl, msgList)
}
}

0 comments on commit bf20f76

Please sign in to comment.