mirror of
https://github.com/curl/curl.git
synced 2026-07-27 17:58:59 +03:00
test447: test PUTting a file that grows
... and have curl trim the end when it reaches the expected total amount of bytes instead of over-sending. Reported-by: JustAnotherArchivist on github Closes #11223
This commit is contained in:
parent
1f85420a28
commit
bfa7006424
3 changed files with 77 additions and 1 deletions
|
|
@ -319,6 +319,17 @@ static CURLcode pre_transfer(struct GlobalConfig *global,
|
|||
if(S_ISREG(fileinfo.st_mode))
|
||||
uploadfilesize = fileinfo.st_size;
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
/* allow dedicated test cases to override */
|
||||
{
|
||||
char *ev = getenv("CURL_UPLOAD_SIZE");
|
||||
if(ev) {
|
||||
int sz = atoi(ev);
|
||||
uploadfilesize = (curl_off_t)sz;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(uploadfilesize != -1) {
|
||||
struct OperationConfig *config = per->config; /* for the macro below */
|
||||
#ifdef CURL_DISABLE_LIBCURL_OPTION
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue