fix infinite loop in mux dispatch

pull/1366/head v4.0.2
Darien Raymond 2018-11-04 08:59:34 +01:00
parent fcce267e33
commit db6d6a89df
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 1 deletions

View File

@ -25,7 +25,7 @@ type ClientManager struct {
}
func (m *ClientManager) Dispatch(ctx context.Context, link *transport.Link) error {
for {
for i := 0; i < 16; i++ {
worker, err := m.Picker.PickAvailable()
if err != nil {
return err
@ -34,6 +34,8 @@ func (m *ClientManager) Dispatch(ctx context.Context, link *transport.Link) erro
return nil
}
}
return newError("unable to find an available mux client")
}
type WorkerPicker interface {