From d4f52ae67f007ceacfc1a3ea2d0678600b0df73d Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 12 Mar 2016 00:52:04 +0100 Subject: Net::IMAP::InterIMAP: set binmode on the socket (and our pipe ends) --- lib/Net/IMAP/InterIMAP.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Net/IMAP/InterIMAP.pm') diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm index 1686448..f3e9c9e 100644 --- a/lib/Net/IMAP/InterIMAP.pm +++ b/lib/Net/IMAP/InterIMAP.pm @@ -313,6 +313,9 @@ sub new($%) { foreach ($rd, $wd) { close $_ or $self->panic("Can't close: $!"); } + foreach (qw/STDIN STDOUT/) { + binmode($self->{$_}) // $self->panic("binmode: $!") + } } else { foreach (qw/host port/) { @@ -338,10 +341,10 @@ sub new($%) { setsockopt($socket, Socket::IPPROTO_TCP, 18, 1000 * $cnt * $intvl) or $self->fail("Can't setsockopt TCP_USER_TIMEOUT: $!"); + binmode($socket) // $self->panic("binmode: $!"); $self->_start_ssl($socket) if $self->{type} eq 'imaps'; $self->{$_} = $socket for qw/STDOUT STDIN/; } - binmode $self->{$_} foreach qw/STDIN STDOUT/; # command counter $self->{_TAG} = 0; -- cgit v1.2.3