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
Updated by bpot (Bob Potter) almost 15 years ago
- File imap_hang_fix.patch imap_hang_fix.patch added
- File imap_hang_test.patch imap_hang_test.patch added
=begin
=end
Updated by shugo (Shugo Maeda) almost 15 years ago
- Status changed from Open to Assigned
- Assignee set to shugo (Shugo Maeda)
=begin
=end
Updated by shugo (Shugo Maeda) almost 15 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r26599.
Bob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end