Project

General

Profile

Actions

Bug #14051

closed

net/imap issue on idle method with an empty block

Added by simayosi (SHIMAYOSHI Takao) over 6 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
[ruby-core:83554]

Description

Description
If Net::IMAP#idle method is called with empty block, all response handlers that have added beforehand are unintentionally removed before returning from the call.

Sample Code
imap.add_response_handler do |resp|
if resp.kind_of?(Net::IMAP::UntaggedResponse) and resp.name == "EXISTS"
imap.idle_done
end
end
imap.idle {}

the response handler firstly added is unregistered here

Cause
@response_handlers.delete(nil) is executed in Net::IMAP#remove_response_handler called from the idle method.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0