mirror of
https://github.com/curl/curl.git
synced 2026-08-25 15:13:41 +03:00
Made -D option work with -O and -J.
To achieve this, first new structure HeaderData is defined to hold necessary data to perform header-related work. Then tool_header_cb now receives HeaderData pointer as userdata. All header-related work (currently, dumping header and Content-Disposition inspection) are done in this callback function. HeaderData.outs->config is used to determine whether each work is done. Unit tests were also updated because after this change, curl code always sets CURLOPT_HEADERFUNCTION and CURLOPT_HEADERDATA. Tested with -O -J -D, -O -J -i and -O -J -D -i and all worked fine.
This commit is contained in:
parent
9c480490f7
commit
b061fed981
11 changed files with 43 additions and 13 deletions
|
|
@ -85,6 +85,8 @@ int main(int argc, char *argv[])
|
|||
CURLOPT_STDERR set to a objectpointer
|
||||
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
||||
CURLOPT_DEBUGDATA set to a objectpointer
|
||||
CURLOPT_HEADERFUNCTION set to a functionpointer
|
||||
CURLOPT_HEADERDATA set to a objectpointer
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,8 @@ int main(int argc, char *argv[])
|
|||
CURLOPT_STDERR set to a objectpointer
|
||||
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
||||
CURLOPT_DEBUGDATA set to a objectpointer
|
||||
CURLOPT_HEADERFUNCTION set to a functionpointer
|
||||
CURLOPT_HEADERDATA set to a objectpointer
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ int main(int argc, char *argv[])
|
|||
CURLOPT_STDERR set to a objectpointer
|
||||
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
||||
CURLOPT_DEBUGDATA set to a objectpointer
|
||||
CURLOPT_HEADERFUNCTION set to a functionpointer
|
||||
CURLOPT_HEADERDATA set to a objectpointer
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ int main(int argc, char *argv[])
|
|||
CURLOPT_STDERR set to a objectpointer
|
||||
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
||||
CURLOPT_DEBUGDATA set to a objectpointer
|
||||
CURLOPT_HEADERFUNCTION set to a functionpointer
|
||||
CURLOPT_HEADERDATA set to a objectpointer
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -141,6 +141,8 @@ int main(int argc, char *argv[])
|
|||
CURLOPT_STDERR set to a objectpointer
|
||||
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
||||
CURLOPT_DEBUGDATA set to a objectpointer
|
||||
CURLOPT_HEADERFUNCTION set to a functionpointer
|
||||
CURLOPT_HEADERDATA set to a objectpointer
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ int main(int argc, char *argv[])
|
|||
CURLOPT_STDERR set to a objectpointer
|
||||
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
||||
CURLOPT_DEBUGDATA set to a objectpointer
|
||||
CURLOPT_HEADERFUNCTION set to a functionpointer
|
||||
CURLOPT_HEADERDATA set to a objectpointer
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@ int main(int argc, char *argv[])
|
|||
CURLOPT_STDERR set to a objectpointer
|
||||
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
||||
CURLOPT_DEBUGDATA set to a objectpointer
|
||||
CURLOPT_HEADERFUNCTION set to a functionpointer
|
||||
CURLOPT_HEADERDATA set to a objectpointer
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ int main(int argc, char *argv[])
|
|||
CURLOPT_STDERR set to a objectpointer
|
||||
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
||||
CURLOPT_DEBUGDATA set to a objectpointer
|
||||
CURLOPT_HEADERFUNCTION set to a functionpointer
|
||||
CURLOPT_HEADERDATA set to a objectpointer
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue