mirror of
https://github.com/curl/curl.git
synced 2026-05-02 21:07:51 +03:00
curl: upload from '.' fix
CURLOPT_NOPROGRESS is being set twice, if a file is uploaded from '.'. Fix order of options so that '.' can override the global setting. Without this, the `tool_readbusy_cb()` is never inoked and cannot unpause a transfer waiting for more input. Fixes #17513 Reported-by: denandz on github Closes #17517
This commit is contained in:
parent
d591bc1416
commit
78dd083788
12 changed files with 38 additions and 30 deletions
|
|
@ -640,13 +640,24 @@ static CURLcode ftp_setopts(struct GlobalConfig *global,
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static void gen_trace_setopts(struct GlobalConfig *global,
|
||||
struct OperationConfig *config,
|
||||
CURL *curl)
|
||||
{
|
||||
if(global->tracetype != TRACE_NONE) {
|
||||
my_setopt(curl, CURLOPT_DEBUGFUNCTION, tool_debug_cb);
|
||||
my_setopt(curl, CURLOPT_DEBUGDATA, config);
|
||||
my_setopt_long(curl, CURLOPT_VERBOSE, 1L);
|
||||
}
|
||||
}
|
||||
|
||||
static void gen_cb_setopts(struct GlobalConfig *global,
|
||||
struct OperationConfig *config,
|
||||
struct per_transfer *per,
|
||||
CURL *curl)
|
||||
{
|
||||
(void) global; /* for builds without --libcurl */
|
||||
|
||||
(void) config;
|
||||
/* where to store */
|
||||
my_setopt(curl, CURLOPT_WRITEDATA, per);
|
||||
my_setopt(curl, CURLOPT_INTERLEAVEDATA, per);
|
||||
|
|
@ -678,12 +689,6 @@ static void gen_cb_setopts(struct GlobalConfig *global,
|
|||
my_setopt(curl, CURLOPT_XFERINFODATA, per);
|
||||
}
|
||||
|
||||
if(global->tracetype != TRACE_NONE) {
|
||||
my_setopt(curl, CURLOPT_DEBUGFUNCTION, tool_debug_cb);
|
||||
my_setopt(curl, CURLOPT_DEBUGDATA, config);
|
||||
my_setopt_long(curl, CURLOPT_VERBOSE, 1L);
|
||||
}
|
||||
|
||||
my_setopt(curl, CURLOPT_HEADERFUNCTION, tool_header_cb);
|
||||
my_setopt(curl, CURLOPT_HEADERDATA, per);
|
||||
}
|
||||
|
|
@ -799,7 +804,7 @@ CURLcode config2setopts(struct GlobalConfig *global,
|
|||
return result;
|
||||
#endif
|
||||
|
||||
gen_cb_setopts(global, config, per, curl);
|
||||
gen_trace_setopts(global, config, curl);
|
||||
|
||||
{
|
||||
#ifdef DEBUGBUILD
|
||||
|
|
@ -822,6 +827,9 @@ CURLcode config2setopts(struct GlobalConfig *global,
|
|||
my_setopt_str(curl, CURLOPT_URL, per->url);
|
||||
my_setopt_long(curl, CURLOPT_NOPROGRESS,
|
||||
global->noprogress || global->silent);
|
||||
/* call after the line above. It may override CURLOPT_NOPROGRESS */
|
||||
gen_cb_setopts(global, config, per, curl);
|
||||
|
||||
if(config->no_body)
|
||||
my_setopt_long(curl, CURLOPT_NOBODY, 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -82,14 +82,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -101,14 +101,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -87,14 +87,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -82,14 +82,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -157,14 +157,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -102,14 +102,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -93,14 +93,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -73,14 +73,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -78,14 +78,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -90,14 +90,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ int main(int argc, char *argv[])
|
|||
as source easily. You may choose to either not use them or implement
|
||||
them yourself.
|
||||
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_WRITEDATA was set to an object pointer
|
||||
CURLOPT_WRITEFUNCTION was set to a function pointer
|
||||
CURLOPT_READDATA was set to an object pointer
|
||||
CURLOPT_READFUNCTION was set to a function pointer
|
||||
CURLOPT_SEEKDATA was set to an object pointer
|
||||
CURLOPT_SEEKFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGFUNCTION was set to a function pointer
|
||||
CURLOPT_DEBUGDATA was set to an object pointer
|
||||
CURLOPT_HEADERFUNCTION was set to a function pointer
|
||||
CURLOPT_HEADERDATA was set to an object pointer
|
||||
CURLOPT_ERRORBUFFER was set to an object pointer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue