Skip to content

Commit

Permalink
o curl -d @filename when 'filename' was not possible to access no longer
Browse files Browse the repository at this point in the history
  converts the request to a GET, but now instead makes it a POST of no data
o The time condition illegal syntax warning is now inhibited if -s is used.
  • Loading branch information
bagder committed Aug 12, 2005
1 parent 162f58c commit 639857c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main.c
Expand Up @@ -1749,8 +1749,15 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
postdata = file2memory(file, &config->postfieldsize);
else
postdata = file2string(file);

if(file && (file != stdin))
fclose(file);

if(!postdata) {
/* no data from the file, point to a zero byte string to make this
get sent as a POST anyway */
postdata=strdup("");
}
}
else {
GetStr(&postdata, nextarg);
Expand Down Expand Up @@ -2205,10 +2212,11 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
if(-1 == stat(nextarg, &statbuf)) {
/* failed, remove time condition */
config->timecond = CURL_TIMECOND_NONE;
fprintf(stderr,
"Warning: Illegal date format for -z/--timecond and not "
"a file name.\n"
" See curl_getdate(3) for valid date syntax.\n");
if(!(config->conf & CONF_MUTE))
fprintf(stderr,
"Warning: Illegal date format for -z/--timecond and not "
"a file name.\n"
" See curl_getdate(3) for valid date syntax.\n");
}
else {
/* pull the time out from the file */
Expand Down

0 comments on commit 639857c

Please sign in to comment.