fix: 仅向已握手连接推送并拆分调度循环
This commit is contained in:
@@ -57,7 +57,7 @@ func (e *deliveryEnv) setNow(ms int64) {
|
||||
}
|
||||
|
||||
func (e *deliveryEnv) online(id string, connID port.ConnID) {
|
||||
e.conns.Set(id, LiveConn{ConnID: connID, MaxReceiveBytes: 0, MaxPacketSize: 0})
|
||||
e.conns.Set(id, LiveConn{ConnID: connID, MaxReceiveBytes: 0, MaxPacketSize: 0, Ready: true})
|
||||
}
|
||||
|
||||
func (e *deliveryEnv) deliveryState(seq int64, endpointID string) (state, reason string) {
|
||||
@@ -586,7 +586,7 @@ func TestDeliveryStateMachine(t *testing.T) {
|
||||
e := openDeliveryEnv(t, nil)
|
||||
insertEndpoint(t, e.db, "alice", "", 1, 0)
|
||||
insertEndpoint(t, e.db, "bob", "", 1, 0)
|
||||
e.conns.Set("bob", LiveConn{ConnID: "c-bob", MaxReceiveBytes: 50})
|
||||
e.conns.Set("bob", LiveConn{ConnID: "c-bob", MaxReceiveBytes: 50, Ready: true})
|
||||
ctx := context.Background()
|
||||
req := baseSend("big1", "bob")
|
||||
req.Body.Data = string(make([]byte, 200))
|
||||
|
||||
Reference in New Issue
Block a user