Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 因为媒体服务器不存在 而导致的 panic - 数组溢出 ,并且新增媒体服务器提示状态. #347

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions client/internal/highway/highway.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,28 @@ func (s *Session) connect(addr Addr) (persistConn, error) {
func (s *Session) nextAddr() Addr {
s.addrMu.Lock()
defer s.addrMu.Unlock()

if len(s.SsoAddr) == 0 {
//fmt.Println("test")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除不用的注释。

/**
* Written by Bash
* 没办法了,只有把媒体服务器地址写死在服务器里面,算是一种曲线救国
*/
Addre := [4]int{1936450177, 3211518593, 761732366, 993564539}
SudoSuBash marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所有变量名首字母小写。

Copy link
Author

@SudoSuBash SudoSuBash Feb 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

抱歉,请把我这个pull requests删除了吧,目前测试,这种方法在发送语音时接口仍会报错199,但是在转发消息的时候它正常工作了。
目前不知道有好的解决方案。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pr是删不掉的,只能close。

Port := [4]int{80, 8080, 443, 80}

for i := 0; i < len(Addre); i++ {
addr := Addr{
IP: uint32(Addre[i]),
Port: Port[i],
}
s.SsoAddr = append(s.SsoAddr, addr)
}

//s.AppendAddr(1153745079,8080)
//fmt.Println(len(s.SsoAddr))
}

addr := s.SsoAddr[s.idx]
s.idx = (s.idx + 1) % len(s.SsoAddr)
return addr
Expand Down
2 changes: 2 additions & 0 deletions client/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func (c *QQClient) ConnectionQualityTest() *ConnectionQualityInfo {
c.error("test srv server latency error: %v", err)
r.SrvServerLatency = 9999
}
} else {
r.SrvServerPacketLoss = -1
}
}()
go func() {
Expand Down
Loading