Skip Menu |
 

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

Report information
The Basics
Id: 78419
Status: rejected
Priority: 0/
Queue: Net-Telnet

People
Owner: Nobody in particular
Requestors: beryllium [...] shaddybaddah.name
Cc:
AdminCc:

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



From beryllium [...] shaddybaddah.name Mon Jul 16 23: 54:45 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-2.2 tagged_above=-99.9 required=10 tests=[AWL=1.201, BAYES_00=-1.9, FROM_12LTRDOM=3.499, RCVD_IN_DNSWL_HI=-5] autolearn=ham
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"; format="flowed"
Message-ID: <5004E1FB.1080905 [...] shaddybaddah.name>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Antiabuse: This header was added to track abuse, please include it with any abuse report
X-Antiabuse: Primary Hostname - svr127.edns1.com
X-Antiabuse: Original Domain - rt.cpan.org
X-Antiabuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-Antiabuse: Sender Address Domain - shaddybaddah.name
X-Spam-Score: -2.2
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 917312403CB for <cpan-bug+Net-Telnet [...] hipster.bestpractical.com>; Mon, 16 Jul 2012 23:54:45 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FDi-dMki6wtX for <cpan-bug+Net-Telnet [...] hipster.bestpractical.com>; Mon, 16 Jul 2012 23:54:43 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 0E54F24027C for <bug-Net-Telnet [...] rt.cpan.org>; Mon, 16 Jul 2012 23:54:42 -0400 (EDT)
Received: (qmail 3898 invoked by uid 103); 17 Jul 2012 03:54:42 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 17 Jul 2012 03:54:42 -0000
Received: from svr127.edsn1.com (HELO svr127.edns1.com) (50.28.77.88) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Mon, 16 Jul 2012 20:54:38 -0700
Received: from [148.182.37.89] (port=60243 helo=[10.0.2.15]) by svr127.edns1.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77) (envelope-from <beryllium [...] shaddybaddah.name>) id 1Sqyrq-0004Iy-BX for bug-Net-Telnet [...] rt.cpan.org; Mon, 16 Jul 2012 23:54:34 -0400
Delivered-To: cpan-bug+Net-Telnet [...] hipster.bestpractical.com
Subject: read error: Connection reset by peer at... unbuffered reads problematic
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.4) Gecko/20120510 Icedove/10.0.4
Return-Path: <beryllium [...] shaddybaddah.name>
X-RT-Mail-Extension: net-telnet
X-Original-To: cpan-bug+Net-Telnet [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Date: Tue, 17 Jul 2012 13:54:35 +1000
X-Spam-Level:
To: bug-Net-Telnet [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Shaddy Baddah <beryllium [...] shaddybaddah.name>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 1131
Download (untitled) / with headers
text/plain 1.1k
Hi, I have an application that uses Net::Telnet to authenticate against a server by telnet. Unfortunately, dependent on the target server, I encounter: read error: Connection reset by peer at... It is true that the telnet server forces the connection closed. Unfortunately when it does this my application is unable to read the final lines of response from the server, due to this issue. I had a look through Telnet.pm and note that the main system call for reading back the data is sysread(): $nread = sysread $self, $s->{buf}, $s->{blksize}, $read_pos; and from the documentation [http://perldoc.perl.org/functions/sysread.html] I note that: "It bypasses buffered IO". This to me would account for the problem I am facing. I'm not suggesting using it is an error. In fact, I am fairly confident there is a good reason for its use. However, I think it is a bug that a check and read of any final data sent by the remote peer has not been implemented; if possible with the sysread() implementation; or otherwise, not to just use buffered I/O in a way that allows for coverage of all data sent back. -- Thanks, Shaddy
MIME-Version: 1.0
In-Reply-To: <5004E1FB.1080905 [...] shaddybaddah.name>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <5004E1FB.1080905 [...] shaddybaddah.name>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-27065-1355630976-600.78419-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 249
Download (untitled) / with headers
text/plain 249b
The note in the Perl doc about sysread "bypasses buffered IO" is a problem when mixing buffered and unbuffered I/O. Net::Telnet only reads from the object using sysread(). All data will be read by sysread() up to eof, timeout, or some other error.
From beryllium [...] shaddybaddah.name Sun Dec 16 05: 55:49 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-4.399 tagged_above=-99.9 required=10 tests=[AWL=2.501, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-27065-1355630976-1283.78419-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-78419 [...] rt.cpan.org> <5004E1FB.1080905 [...] shaddybaddah.name> <rt-3.8.HEAD-27065-1355630976-1283.78419-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <50CDA89C.7090902 [...] shaddybaddah.name>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-RT-Original-Encoding: utf-8
X-Spam-Score: -4.399
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 4E4F1240AF9 for <cpan-bug+Net-Telnet [...] hipster.bestpractical.com>; Sun, 16 Dec 2012 05:55:49 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lTzD1i8fDdBo for <cpan-bug+Net-Telnet [...] hipster.bestpractical.com>; Sun, 16 Dec 2012 05:55:47 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 95D37240AF7 for <bug-Net-Telnet [...] rt.cpan.org>; Sun, 16 Dec 2012 05:55:46 -0500 (EST)
Received: (qmail 21136 invoked by uid 103); 16 Dec 2012 10:55:45 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Dec 2012 10:55:45 -0000
Received: from milton.worldispnetwork.com (HELO milton.worldispnetwork.com) (67.217.57.10) by 16.mx.develooper.com (qpsmtpd/0.84/v0.84-167-g4ed6cab) with ESMTP; Sun, 16 Dec 2012 02:55:42 -0800
Received: (qmail 18770 invoked by uid 399); 16 Dec 2012 10:55:18 -0000
Received: from c122-106-16-37.rivrw1.nsw.optusnet.com.au (HELO ?10.0.2.15?) (career [...] shaddybaddah.name [...] 122.106.16.37) by milton.worldispnetwork.com with ESMTPAM; 16 Dec 2012 10:55:18 -0000
Delivered-To: cpan-bug+Net-Telnet [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.5) Gecko/20120624 Icedove/10.0.5
Subject: Re: [rt.cpan.org #78419] read error: Connection reset by peer at... unbuffered reads problematic
Return-Path: <beryllium [...] shaddybaddah.name>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Net-Telnet [...] hipster.bestpractical.com
X-RT-Mail-Extension: net-telnet
Date: Sun, 16 Dec 2012 21:55:24 +1100
X-Spam-Level:
X-Originating-Ip: 122.106.16.37
To: bug-Net-Telnet [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Shaddy Baddah <beryllium [...] shaddybaddah.name>
RT-Message-ID: <rt-3.8.HEAD-22096-1355655350-1086.78419-0-0 [...] rt.cpan.org>
Content-Length: 1423
Download (untitled) / with headers
text/plain 1.3k
Hi, On 16/12/12 15:09, Jay Rogers via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=78419> > > The note in the Perl doc about sysread "bypasses buffered IO" is a > problem when mixing buffered and unbuffered I/O. Net::Telnet only reads > from the object using sysread(). All data will be read by sysread() up > to eof, timeout, or some other error.
Yes, I understand. But what I am claiming is this... no, not all data is read. I believe the eof is given a higher priority over data that has been received first, but based on timing, has not been read. So what I mean is, data arrives, but thread has not looped back to sysread(). In between, the remote peer closes the connection (hard up against sending the final output), and when sysread() is finally executed, the eof overrides the received data. Further, I am claiming this does not happen with buffered I/O. The eof is queued behind the final data received. I make this claim because the regular telnet client outputs this final bit of data (so obviously reads it) before exiting. This does not seem possible with sysread(). I say seem, because my experimentation, and understanding of sysread() has led me to that conclusion. To be fair, I think the onus is on me to generate a test case that can demonstrate Net::Telnet failing to read that final data. If I get some free time soon, I'll try and generate such a test. -- Regards, Shaddy
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-22096-1355655350-1086.78419-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <RT-Ticket-78419 [...] rt.cpan.org> <5004E1FB.1080905 [...] shaddybaddah.name> <rt-3.8.HEAD-27065-1355630976-1283.78419-6-0 [...] rt.cpan.org> <50CDA89C.7090902 [...] shaddybaddah.name> <rt-3.8.HEAD-22096-1355655350-1086.78419-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-4400-1355677739-1986.78419-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 78
Thanks for your feedback. Yes a test case would help demonstrate the problem.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.