Skip Menu |

This queue is for tickets about the Net-IMAP-Client CPAN distribution.

Report information
The Basics
Id: 48163
Status: resolved
Priority: 0/
Queue: Net-IMAP-Client

People
Owner: Nobody in particular
Requestors: hal [...] umich.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.95



CC: mihai.bazon [...] gmail.com
Subject: Net::IMAP::Client - error after logout
Date: Fri, 24 Jul 2009 09:49:17 -0400
To: bug-Net-IMAP-Client [...] rt.cpan.org
From: Harry Levinson <harry.levinson [...] gmail.com>
I am trying your NET::IMAP::Client module. Version 0.92. . A short test works fine except when exiting. The logout method seems to close the socket, but when I execute an exit command, the destructor doesn't seem to realize that the socket is already closed. main::(t2.pl:33): $imap->logout; DB<1> main::(t2.pl:35): exit; DB<1> setsockopt() on closed socket GEN0 at /usr/lib/perl/5.8/IO/Socket.pm line 247. at /usr/lib/perl/5.8/IO/Socket.pm line 247 IO::Socket::setsockopt('IO::Socket::SSL=GLOB(0x872062c)', 1, 9, 1) called at /usr/lib/perl/5.8/IO/Socket.pm line 263 IO::Socket::sockopt('IO::Socket::SSL=GLOB(0x872062c)', 9, 1) called at /usr/local/share/perl/5.8.8/Net/IMAP/Client.pm line 589 Net::IMAP::Client::_get_socket('Net::IMAP::Client=HASH(0x87204b8)') called at /usr/local/share/perl/5.8.8/Net/IMAP/Client.pm line 50 eval {...} called at /usr/local/share/perl/5.8.8/Net/IMAP/Client.pm line 49 Net::IMAP::Client::DESTROY('Net::IMAP::Client=HASH(0x87204b8)') called at t2.pl line 0 eval {...} called at t2.pl line 0 If useful, here is the complete test use Net::IMAP::Client; my $imap = Net::IMAP::Client->new( server => 'exchange.kendall.corp.akamai.com', user => 'username', pass => '*****', ssl => 1, # (use SSL? default no) port => 993, # (but defaults are sane) uid_mode => 0 # Not sure why UID is default ) or die "Could not connect to IMAP server"; $imap->login or die('Login failed: ' . $imap->last_error); my $capab = $imap->capability; $imap->select('INBOX') or die "Could not select INBOX"; $imap->logout; exit;
From: tammer [...] tammer.net
Hello, I do have the same problem, any ideas? Bye Rainer
Subject: Re: [rt.cpan.org #48163] Net::IMAP::Client - error after logout
Date: Fri, 8 Apr 2011 04:11:57 -1000
To: Rainer Tammer via RT <bug-Net-IMAP-Client [...] rt.cpan.org>
From: Joel Roth <joelz [...] pobox.com>
On Fri, Apr 08, 2011 at 07:53:42AM -0400, Rainer Tammer via RT wrote: Show quoted text
> Queue: Net-IMAP-Client > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48163 > > > Hello, > I do have the same problem, any ideas?
Hi, I've recently taken over maintaining this module. Looking at the source, I see that the object DESTROY method, calls _get_socket, which calls setsockopt() on the Socket::IO object. That could generate some noise on STDERR. Note the DESTROY method's code is wrapped in an eval, which means the error is trapped. Here is a patch: diff --git a/lib/Net/IMAP/Client.pm b/lib/Net/IMAP/Client.pm index abbe993..4993ff0 100644 --- a/lib/Net/IMAP/Client.pm +++ b/lib/Net/IMAP/Client.pm @@ -48,7 +48,7 @@ sub DESTROY { my ($self) = @_; eval { $self->quit - if $self->_get_socket->opened; + if $self->{socket}->opened; }; } Regards, Joel Show quoted text
> Bye > Rainer
-- Joel Roth
I've uploaded a new version 0.95, with the fix previously posted. Let me know if this works for you. Also, I would be interested if the problem actually affected your use of this module. Regards, Joel
I am marking this bug resolved.