Make downstreamConn.runUntilegistered exit with an error on EOF

This commit is contained in:
Simon Ser 2020-03-16 14:30:49 +01:00
parent 75e698f671
commit b1b519d4f9
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -492,9 +492,7 @@ func (dc *downstreamConn) register() error {
func (dc *downstreamConn) runUntilRegistered() error { func (dc *downstreamConn) runUntilRegistered() error {
for !dc.registered { for !dc.registered {
msg, err := dc.irc.ReadMessage() msg, err := dc.irc.ReadMessage()
if err == io.EOF { if err != nil {
break
} else if err != nil {
return fmt.Errorf("failed to read IRC command: %v", err) return fmt.Errorf("failed to read IRC command: %v", err)
} }