mirror of
https://github.com/curl/curl.git
synced 2026-07-24 12:17:16 +03:00
mime: drop internal FILE * support.
- The part kind MIMEKIND_FILE and associated code are suppressed. - Seek data origin offset not used anymore: suppressed. - MIMEKIND_NAMEDFILE renamed MIMEKIND_FILE; associated fields/functions renamed accordingly. - Curl_getformdata() processes stdin via a callback.
This commit is contained in:
parent
d1da545a68
commit
c96d96bc5f
4 changed files with 81 additions and 144 deletions
|
|
@ -897,8 +897,16 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
|
|||
clen = -1;
|
||||
|
||||
if(post->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE)) {
|
||||
if(!strcmp(file->contents, "-"))
|
||||
result = Curl_mime_file(part, stdin, 0);
|
||||
if(!strcmp(file->contents, "-")) {
|
||||
/* There are a few cases where the code below won't work; in
|
||||
particular, freopen(stdin) by the caller is not guaranteed
|
||||
to result as expected. This feature has been kept for backward
|
||||
compatibility: use of "-" pseudo file name should be avoided. */
|
||||
result = curl_mime_data_cb(part, (curl_off_t) -1,
|
||||
(curl_read_callback) fread,
|
||||
(curl_seek_callback) fseek,
|
||||
NULL, (void *) stdin);
|
||||
}
|
||||
else
|
||||
result = curl_mime_filedata(part, file->contents);
|
||||
if(!result && (post->flags & HTTPPOST_READFILE))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue