Loading lib/file.c +21 −23 Original line number Diff line number Diff line Loading @@ -469,6 +469,9 @@ static CURLcode file_do(struct connectdata *conn, bool *done) information. Which for FILE can't be much more than the file size and date. */ if(data->set.opt_no_body && data->set.include_header && fstated) { time_t filetime; struct tm buffer; const struct tm *tm = &buffer; snprintf(buf, sizeof(data->state.buffer), "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", expected_size); result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); Loading @@ -480,10 +483,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done) if(result) return result; if(fstated) { time_t filetime = (time_t)statbuf.st_mtime; struct tm buffer; const struct tm *tm = &buffer; filetime = (time_t)statbuf.st_mtime; result = Curl_gmtime(filetime, &buffer); if(result) return result; Loading @@ -499,10 +499,8 @@ static CURLcode file_do(struct connectdata *conn, bool *done) tm->tm_min, tm->tm_sec); result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); } /* if we fstat()ed the file, set the file size to make it available post- transfer */ if(fstated) if(!result) /* set the file size to make it available post transfer */ Curl_pgrsSetDownloadSize(data, expected_size); return result; } Loading Loading
lib/file.c +21 −23 Original line number Diff line number Diff line Loading @@ -469,6 +469,9 @@ static CURLcode file_do(struct connectdata *conn, bool *done) information. Which for FILE can't be much more than the file size and date. */ if(data->set.opt_no_body && data->set.include_header && fstated) { time_t filetime; struct tm buffer; const struct tm *tm = &buffer; snprintf(buf, sizeof(data->state.buffer), "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", expected_size); result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); Loading @@ -480,10 +483,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done) if(result) return result; if(fstated) { time_t filetime = (time_t)statbuf.st_mtime; struct tm buffer; const struct tm *tm = &buffer; filetime = (time_t)statbuf.st_mtime; result = Curl_gmtime(filetime, &buffer); if(result) return result; Loading @@ -499,10 +499,8 @@ static CURLcode file_do(struct connectdata *conn, bool *done) tm->tm_min, tm->tm_sec); result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); } /* if we fstat()ed the file, set the file size to make it available post- transfer */ if(fstated) if(!result) /* set the file size to make it available post transfer */ Curl_pgrsSetDownloadSize(data, expected_size); return result; } Loading