cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_perform never returns for telnet connection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 11 Aug 2009 13:39:19 +0200 (CEST)

On Fri, 7 Aug 2009, Vladimir A. Petrov wrote:

>> At what particular moment did you expect the "transfer" to end? A telnet
>> server is usually around always and libcurl will just hang on to it... You
>> need to return something in your write or progress callback to force it to
>> abort.
>
> OK. I understand that. But the question is what I have to do to send data to
> the host? How can I obtain a file descriptor or whatever for it? I've looked
> through all header files and I didn't find anything useful. This looks
> strange for me.

It is strange. The telnet code reads from stdin(!) and sends that data to the
remote server. It's awkward yes, but nobody has fixed this...

The telnet code also has its own loop which also should be fixed and it should
use the general internal transfer concept. But in general, telnet is not very
suitable for the libcurl paradigms of doing file transfers, as telnet is more
of an interactive back-and-forth thing with no decent protocol for meta-data
and auth etc.

-- 
  / daniel.haxx.se
Received on 2009-08-11