Remove bogus optimisation of telnet upload.
authorColin Hogben <curl@pythontech.co.uk>
Wed, 4 Jan 2012 11:24:49 +0000 (11:24 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 18 Jan 2012 21:17:46 +0000 (22:17 +0100)
Remove wrongly implemented optimisation of telnet upload, apparently
intended to allow the library to avoid manually polling for input.

src/tool_operate.c

index bf73479..a6f6f0b 100644 (file)
@@ -767,11 +767,16 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
         /* for uploads */
         input.fd = infd;
         input.config = config;
+        /* Note that if CURLOPT_READFUNCTION is fread (the default), then
+         * lib/telnet.c will Curl_poll() on the input file descriptor
+         * rather then calling the READFUNCTION at regular intervals.
+         * The circumstances in which it is preferable to enable this
+         * behaviour, by omitting to set the READFUNCTION & READDATA options,
+         * have not been determined.
+         */
         my_setopt(curl, CURLOPT_READDATA, &input);
         /* what call to read */
-        if((outfile && !curlx_strequal("-", outfile)) ||
-           !checkprefix("telnet:", this_url))
-          my_setopt(curl, CURLOPT_READFUNCTION, tool_read_cb);
+        my_setopt(curl, CURLOPT_READFUNCTION, tool_read_cb);
 
         /* in 7.18.0, the CURLOPT_SEEKFUNCTION/DATA pair is taking over what
            CURLOPT_IOCTLFUNCTION/DATA pair previously provided for seeking */