go-imap icon indicating copy to clipboard operation
go-imap copied to clipboard

Fix connection hang

Open doganpoyraz opened this issue 4 months ago • 0 comments

This PR fixes the issue described in #611.

If the server does not respond to the Support calls in the New() function, the function blocks infinitely. Even if we supply a dialer with a timeout, there are 2 consequent Support calls. The first one runs with a deadline value but during the execution of the 2nd one, the deadline was set to the zero value. Setting the timeout value to the client is not enough because the client is not returned to the user yet.

I also added an optional timeout parameter to the DialWithDialer functions because callers may supply a Dialer that wraps the net.Dialer, which was our case.

doganpoyraz avatar Apr 25 '24 14:04 doganpoyraz