Commit 0a2cbcc0 authored by Loïck Bonniot's avatar Loïck Bonniot

[p] Fix crash if client disconnects before ready

parent e59a0da0
Pipeline #730 passed with stage
......@@ -125,7 +125,7 @@ func (m *SignatureManager) promiseRound(pendingSet, sendSet []uint32, myID uint3
// Verifying we sent all the due promises
for range sendSet {
_ = <-c
<-c
}
}
......
......@@ -62,10 +62,10 @@ func ReadySign(db *mgdb.MongoManager, rooms *common.WaitingGroupMap, ctx *contex
} // data == "" means the contractUUID is bad
return &api.LaunchSignature{ErrorCode: &api.ErrorCode{Code: api.ErrorCode_INVARG}}
}
case <-(*ctx).Done():
case <-(*ctx).Done(): // Client's disconnection
rooms.Unjoin(roomID, channel)
return nil
case <-time.After(10 * time.Minute):
return &api.LaunchSignature{ErrorCode: &api.ErrorCode{Code: api.ErrorCode_INVARG}}
case <-time.After(time.Minute): // Someone has not confirmed the signature within the delay
rooms.Unjoin(roomID, channel)
return &api.LaunchSignature{ErrorCode: &api.ErrorCode{Code: api.ErrorCode_TIMEOUT, Message: "timeout for ready signal"}}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment