Skip to content

Commit af3f36a

Browse files
authored
fix(protocol): include all protocol states in switch (#932)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 41fec8c commit af3f36a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

protocol/protocol.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,12 @@ func (p *Protocol) stateLoop(ch <-chan protocolStateTransition) {
427427

428428
// Mark protocol as ready to send/receive based on role and agency of the new state
429429
switch p.config.StateMap[currentState].Agency {
430+
case AgencyNone:
431+
return
430432
case AgencyClient:
431433
switch p.config.Role {
434+
case ProtocolRoleNone:
435+
return
432436
case ProtocolRoleClient:
433437
select {
434438
case p.sendReadyChan <- true:
@@ -442,6 +446,8 @@ func (p *Protocol) stateLoop(ch <-chan protocolStateTransition) {
442446
}
443447
case AgencyServer:
444448
switch p.config.Role {
449+
case ProtocolRoleNone:
450+
return
445451
case ProtocolRoleServer:
446452
select {
447453
case p.sendReadyChan <- true:

0 commit comments

Comments
 (0)