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:
Daniel Stenberg 2023-05-30 14:45:47 +02:00
parent 1f85420a28
commit bfa7006424
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 77 additions and 1 deletions

View file

@ -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