aboutsummaryrefslogtreecommitdiff
path: root/src/tool_setopt.c
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2017-09-03 14:45:43 +0100
committerPatrick Monnerat <patrick@monnerat.net>2017-09-03 14:45:43 +0100
commit1a3f4c19919b09ff0fd0ba228b06a217d85d4265 (patch)
tree12c70f11b95ded1acfac5b28eeb7499d0ec99e59 /src/tool_setopt.c
parent045b076ae8362006f6977a80e6a5e3ef0eb903eb (diff)
mime: remove support "-" stdin pseudo-file name in curl_mime_filedata().
This feature is badly supported in Windows: as a replacement, a caller has to use curl_mime_data_cb() with fread, fseek and possibly fclose callbacks to process opened files. The cli tool and documentation are updated accordingly. The feature is however kept internally for form API compatibility, with the known caveats it always had. As a side effect, stdin size is not determined by the cli tool even if possible and this results in a chunked transfer encoding. Test 173 is updated accordingly.
Diffstat (limited to 'src/tool_setopt.c')
-rw-r--r--src/tool_setopt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tool_setopt.c b/src/tool_setopt.c
index 4e25e9e12..19646ea69 100644
--- a/src/tool_setopt.c
+++ b/src/tool_setopt.c
@@ -450,9 +450,11 @@ static CURLcode libcurl_generate_mime(curl_mime *mime, int *mimeno)
filename = part->filename;
}
break;
- case MIMEKIND_FILE:
- /* Can only be stdin in the current context. */
- CODE1("curl_mime_file(part%d, \"-\");", *mimeno);
+ case MIMEKIND_CALLBACK:
+ /* Can only be reading stdin in the current context. */
+ CODE1("curl_mime_data_cb(part%d, -1, (curl_read_callback) fread, \\",
+ *mimeno);
+ CODE0(" (curl_seek_callback) fseek, NULL, stdin);");
break;
case MIMEKIND_DATA:
#ifdef CURL_DOES_CONVERSIONS