summaryrefslogtreecommitdiff
path: root/lib/formdata.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 /lib/formdata.c
parent045b076ae8362006f6977a80e6a5e3ef0eb903eb (diff)
downloadcurl-1a3f4c19919b09ff0fd0ba228b06a217d85d4265.tar.gz
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 'lib/formdata.c')
-rw-r--r--lib/formdata.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 129086dee..b7ea21c8c 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -897,7 +897,10 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
clen = -1;
if(post->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE)) {
- result = curl_mime_filedata(part, file->contents);
+ if(!strcmp(file->contents, "-"))
+ result = Curl_mime_file(part, stdin, 0);
+ else
+ result = curl_mime_filedata(part, file->contents);
if(!result && (post->flags & HTTPPOST_READFILE))
result = curl_mime_filename(part, NULL);
}