fix: 在 OnConnect 把 mochi 发送配额置 0 规避死锁
This commit is contained in:
@@ -212,6 +212,11 @@ func connectAndSubscribe(t *testing.T, w net.Conn, endpoint string, maxPacket ui
|
||||
}
|
||||
|
||||
func writeConnect(t *testing.T, w net.Conn, endpoint string, keepalive uint16, maxPacket uint32) {
|
||||
t.Helper()
|
||||
writeConnectFull(t, w, endpoint, keepalive, maxPacket, 0)
|
||||
}
|
||||
|
||||
func writeConnectFull(t *testing.T, w net.Conn, endpoint string, keepalive uint16, maxPacket uint32, receiveMax uint16) {
|
||||
t.Helper()
|
||||
pk := packets.Packet{
|
||||
FixedHeader: packets.FixedHeader{Type: packets.Connect},
|
||||
@@ -228,6 +233,7 @@ func writeConnect(t *testing.T, w net.Conn, endpoint string, keepalive uint16, m
|
||||
},
|
||||
Properties: packets.Properties{
|
||||
MaximumPacketSize: maxPacket,
|
||||
ReceiveMaximum: receiveMax,
|
||||
},
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
|
||||
Reference in New Issue
Block a user