Actions
Bug #2683
closedIMAP hangs when receiving an unexpected "BYE" during login
Description
=begin
The main imap thread will hang if the receiving thread receives an unexpected "BYE" message during login. IMAP#receive_responses (lines 1054-7) sets the exception correctly but fails to break out of the main reading loop because 'break' is called inside of a block. During the next pass through the loop, an exception will be raised causing the receiving thread to die and the main thread to hang indefinitely. I've attached a patch and a test case. The test case should hang with the latest net/imap.rb but pass with the attached patch.
The patch is not very pretty, but I'm hesitant to make any large changes to that method. I'm more than happy to rework the patch if there is a better way to fix it.
=end
Files
Actions
Like0
Like0Like0Like0