cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Weird telnet file handling

From: Colin Hogben <curl_at_pythontech.co.uk>
Date: Wed, 04 Jan 2012 11:35:39 +0000

On 03/01/12 08:55, Colin Hogben wrote:

> Further investigation in lib/telnet.c revealed a partial explanation: if
> READFUNCTION is not set, then input is read from hard-coded file
> descriptor 0 (i.e. stdin) and any setting of READDATA (aka INFILE) is
> disregarded:

> curl telnet://localhost:80 -T in1 -o out < in2
> sends in1 whereas
> curl telnet://localhost:80 -T in1 > out < in2
> sends in2. I think this is another bug.

The attach patches add two test cases for telnet, the second of which
demonstrates the bug; and apply fixes to the library and the tool.
Somebody who knows Windows needs apply an equivalent fix to the
USE_WINSOCK part of lib/telnet.c

-- 
Colin


Received on 2012-01-04