curl-library
Re: Fwd: Re: PATCH: Allow telnet to be used programatically.
Date: Mon, 26 Apr 2010 14:16:49 -0700
On 04/24/2010 12:53 PM, Daniel Stenberg wrote:
> On Sat, 24 Apr 2010, Ben Greear wrote:
>
>>> I don't think we need the flushing, the rest looks fine to me!
>>
>> Maybe just no one ever used it. You need the flush if you want to use
>> 'curl' as a telnet client of any useful nature..otherwise, you don't
>> see the prompts until after you enter data.
>>
>> But, I can remove it if you really want it removed.
>
> First, nobody has complained so it isn't likely many people use the
> default stdout with telnet for anything useful. Then, I don't like to
> distribute (within the code) the knowledge that the default write
> callback writes to stdout. The output is never flushed so the telnet one
> is not special.
>
> *If* we were to flush the output, then I think we should do it by making
> sure the internal default write function does it.
>
> But as a final point: the default output function and stdout stream
> isn't terribly useful or used so I think we should just let it be as it
> is. It simply won't be used by programs.
>
> So yes, I actually want the flush removed.
Do you want me to remove this flush that was already in the code?
@@ -1402,7 +1409,8 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done)
break;
}
- fflush(stdout);
+ if (!data->set.is_fwrite_set)
+ fflush(stdout);
/* Negotiate if the peer has started negotiating,
otherwise don't. We don't want to speak telnet with
Thanks,
Ben
-- Ben Greear <greearb_at_candelatech.com> Candela Technologies Inc http://www.candelatech.com ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2010-04-26