diff options
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r-- | src/tool_operate.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c index 2bee9349a..66f2139c8 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -380,7 +380,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global, /* do not create (or even overwrite) the file in case we get no data because of unmet condition */ curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &cond_unmet); - if(!cond_unmet && !tool_create_output_file(outs)) + if(!cond_unmet && !tool_create_output_file(outs, config)) result = CURLE_WRITE_ERROR; } @@ -866,7 +866,6 @@ static CURLcode single_transfer(struct GlobalConfig *global, /* default headers output stream is stdout */ heads = &per->heads; heads->stream = stdout; - heads->config = config; /* Single header file for all URLs */ if(config->headerfile) { @@ -891,10 +890,22 @@ static CURLcode single_transfer(struct GlobalConfig *global, } } + hdrcbdata = &per->hdrcbdata; + + outs = &per->outs; + input = &per->input; + + per->outfile = NULL; + per->infdopen = FALSE; + per->infd = STDIN_FILENO; + + /* default output stream is stdout */ + outs->stream = stdout; + /* --etag-save */ etag_save = &per->etag_save; etag_save->stream = stdout; - etag_save->config = config; + if(config->etag_save_file) { /* open file for output: */ if(strcmp(config->etag_save_file, "-")) { @@ -961,19 +972,6 @@ static CURLcode single_transfer(struct GlobalConfig *global, } } - hdrcbdata = &per->hdrcbdata; - - outs = &per->outs; - input = &per->input; - - per->outfile = NULL; - per->infdopen = FALSE; - per->infd = STDIN_FILENO; - - /* default output stream is stdout */ - outs->stream = stdout; - outs->config = config; - if(metalink) { /* For Metalink download, use name in Metalink file as filename. */ |