mirror of
https://gitee.com/WuKongDev/WuKongIM.git
synced 2025-12-06 14:59:08 +08:00
reactor: remove fmt.println
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
@@ -596,8 +595,6 @@ func (ch *ChannelAPI) syncMessages(c *wkhttp.Context) {
|
||||
fakeChannelID = GetFakeChannelIDWith(req.LoginUID, req.ChannelID)
|
||||
}
|
||||
|
||||
fmt.Println("fakeChannelID:", fakeChannelID, "req.ChannelType:", req.ChannelType, "req.StartMessageSeq:", req.StartMessageSeq, "req.EndMessageSeq:", req.EndMessageSeq, "limit:", limit)
|
||||
|
||||
if req.StartMessageSeq == 0 && req.EndMessageSeq == 0 {
|
||||
messages, err = ch.s.store.LoadLastMsgs(fakeChannelID, req.ChannelType, limit)
|
||||
} else if req.PullMode == PullModeUp { // 向上拉取
|
||||
|
||||
@@ -203,7 +203,6 @@ func (s *ConversationAPI) syncUserConversation(c *wkhttp.Context) {
|
||||
}
|
||||
|
||||
conversations := s.s.conversationManager.GetConversations(req.UID, req.Version, req.Larges)
|
||||
fmt.Println("conversations---->", len(conversations))
|
||||
var newConversations = make([]*wkstore.Conversation, 0, len(conversations)+20)
|
||||
if conversations != nil {
|
||||
newConversations = append(newConversations, conversations...)
|
||||
|
||||
@@ -288,7 +288,6 @@ func (m *MonitorAPI) channels(c *wkhttp.Context) {
|
||||
fromUID, toUID := GetFromUIDAndToUIDWith(channelID)
|
||||
fakeChannelID = GetFakeChannelIDWith(fromUID, toUID)
|
||||
}
|
||||
fmt.Println("fakeChannelID--->", fakeChannelID)
|
||||
channelInfo, err := m.s.channelManager.GetChannel(fakeChannelID, channelType)
|
||||
if err != nil {
|
||||
m.Error("get channel error", zap.Error(err))
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -70,7 +69,6 @@ func (d *Dispatch) dataIn(conn wknet.Conn) error {
|
||||
return nil
|
||||
}
|
||||
if !conn.IsAuthed() { // conn is not authed must be connect packet
|
||||
fmt.Println("conn is not authed must be connect packet------>")
|
||||
packet, _, err := d.s.opts.Proto.DecodeFrame(data, wkproto.LatestVersion)
|
||||
if err != nil {
|
||||
d.Warn("Failed to decode the message", zap.Error(err))
|
||||
|
||||
@@ -95,13 +95,11 @@ func (p *Processor) processAuth(conn wknet.Conn, connectPacket *wkproto.ConnectP
|
||||
devceLevelI uint8
|
||||
token string
|
||||
)
|
||||
fmt.Println("processAuth-------------->", connectPacket.String())
|
||||
if strings.TrimSpace(connectPacket.ClientKey) == "" {
|
||||
p.responseConnackAuthFail(conn)
|
||||
return
|
||||
}
|
||||
// -------------------- token verify --------------------
|
||||
fmt.Println("processAuth-------------->1")
|
||||
if connectPacket.UID == p.s.opts.ManagerUID {
|
||||
if p.s.opts.ManagerTokenOn && connectPacket.Token != p.s.opts.ManagerToken {
|
||||
p.Error("manager token verify fail", zap.String("uid", uid), zap.String("token", connectPacket.Token))
|
||||
@@ -130,7 +128,6 @@ func (p *Processor) processAuth(conn wknet.Conn, connectPacket *wkproto.ConnectP
|
||||
} else {
|
||||
devceLevel = wkproto.DeviceLevelSlave // 默认都是slave设备
|
||||
}
|
||||
fmt.Println("processAuth-------------->2")
|
||||
|
||||
// -------------------- ban --------------------
|
||||
userChannelInfo, err := p.s.store.GetChannel(uid, wkproto.ChannelTypePerson)
|
||||
@@ -149,8 +146,6 @@ func (p *Processor) processAuth(conn wknet.Conn, connectPacket *wkproto.ConnectP
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("processAuth-------------->3")
|
||||
|
||||
// -------------------- get message encrypt key --------------------
|
||||
dhServerPrivKey, dhServerPublicKey := wkutil.GetCurve25519KeypPair() // 生成服务器的DH密钥对
|
||||
aesKey, aesIV, err := p.getClientAesKeyAndIV(connectPacket.ClientKey, dhServerPrivKey)
|
||||
@@ -161,7 +156,6 @@ func (p *Processor) processAuth(conn wknet.Conn, connectPacket *wkproto.ConnectP
|
||||
}
|
||||
dhServerPublicKeyEnc := base64.StdEncoding.EncodeToString(dhServerPublicKey[:])
|
||||
|
||||
fmt.Println("processAuth-------------->4")
|
||||
// -------------------- same master kicks each other --------------------
|
||||
oldConns := p.s.connManager.GetConnsWith(uid, connectPacket.DeviceFlag)
|
||||
if len(oldConns) > 0 && devceLevel == wkproto.DeviceLevelMaster {
|
||||
@@ -184,7 +178,6 @@ func (p *Processor) processAuth(conn wknet.Conn, connectPacket *wkproto.ConnectP
|
||||
p.Debug("close old conn", zap.Any("oldConn", oldConn))
|
||||
}
|
||||
}
|
||||
fmt.Println("processAuth-------------->5")
|
||||
|
||||
// -------------------- set conn info --------------------
|
||||
timeDiff := time.Now().UnixNano()/1000/1000 - connectPacket.ClientTimestamp
|
||||
@@ -541,7 +534,6 @@ func (p *Processor) sendPacketIsVail(sendPacket *wkproto.SendPacket, c wknet.Con
|
||||
|
||||
// #################### subscribe ####################
|
||||
func (p *Processor) processSubs(conn wknet.Conn, subPackets []*wkproto.SubPacket) {
|
||||
fmt.Println("subPackets--->", len(subPackets))
|
||||
for _, subPacket := range subPackets {
|
||||
p.processSub(conn, subPacket)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package grpcpool
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -12,7 +11,6 @@ import (
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
p, err := New(func() (*grpc.ClientConn, error) {
|
||||
fmt.Println("conn----->")
|
||||
return grpc.Dial("example.com", grpc.WithInsecure())
|
||||
}, 1, 3, 0)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user