Skip to content

Commit f1c3b8a

Browse files
committed
robustsession: don’t assume any GET response restores connectivity
(Originally authored by LionsPhil.) related to robustirc/robustirc#172
1 parent ddd0103 commit f1c3b8a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

robustsession/robustsession.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,6 @@ func (s *RobustSession) getMessages1(lastseen robustId, unavailability *unavaila
600600
}
601601
defer resp.Body.Close()
602602

603-
unavailability.stopAndMaybeNotify()
604-
605603
dec := json.NewDecoder(resp.Body)
606604
msgchan := make(chan robustMessage)
607605
errchan := make(chan error)
@@ -651,6 +649,8 @@ func (s *RobustSession) getMessages1(lastseen robustId, unavailability *unavaila
651649
s.network.failed(target)
652650
return lastseen, nil
653651

652+
// The server injects a PING, so we should always hit this case promptly after a successful GET
653+
// with a valid response, and thus stop unavailability.
654654
case msg := <-msgchan:
655655
unavailability.stopAndMaybeNotify()
656656

0 commit comments

Comments
 (0)