Skip to content

Commit

Permalink
imapclient: fix timeout for initial greeting
Browse files Browse the repository at this point in the history
We were setting the timeout to 0 when waiting for the initial
greeting from the server. Use 30s instead.
  • Loading branch information
emersion committed Apr 25, 2024
1 parent a3d3674 commit ee36cf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imapclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func (c *Client) read() {
c.closeWithError(cmdErr)
}()

c.setReadTimeout(idleReadTimeout)
c.setReadTimeout(respReadTimeout) // We're waiting for the greeting
for {
// Ignore net.ErrClosed here, because we also call conn.Close in c.Close
if c.dec.EOF() || errors.Is(c.dec.Err(), net.ErrClosed) || errors.Is(c.dec.Err(), io.ErrClosedPipe) {
Expand Down

0 comments on commit ee36cf4

Please sign in to comment.