From b061fed981c97bef78679f193173ab55a4dce91e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 25 May 2012 17:33:28 +0900 Subject: 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. --- tests/data/test1400 | 2 ++ tests/data/test1401 | 2 ++ tests/data/test1402 | 2 ++ tests/data/test1403 | 2 ++ tests/data/test1404 | 2 ++ tests/data/test1405 | 2 ++ tests/data/test1406 | 2 ++ tests/data/test1407 | 2 ++ 8 files changed, 16 insertions(+) (limited to 'tests/data') diff --git a/tests/data/test1400 b/tests/data/test1400 index 59b2856dd..72989c4c4 100644 --- a/tests/data/test1400 +++ b/tests/data/test1400 @@ -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 */ diff --git a/tests/data/test1401 b/tests/data/test1401 index e094ec456..e709c8e08 100644 --- a/tests/data/test1401 +++ b/tests/data/test1401 @@ -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 */ diff --git a/tests/data/test1402 b/tests/data/test1402 index d56779207..c3bf834bd 100644 --- a/tests/data/test1402 +++ b/tests/data/test1402 @@ -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 */ diff --git a/tests/data/test1403 b/tests/data/test1403 index 3e4a03440..3ec7dd032 100644 --- a/tests/data/test1403 +++ b/tests/data/test1403 @@ -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 */ diff --git a/tests/data/test1404 b/tests/data/test1404 index f856a7416..88a06ba39 100644 --- a/tests/data/test1404 +++ b/tests/data/test1404 @@ -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 */ diff --git a/tests/data/test1405 b/tests/data/test1405 index 187f84983..692bb1af7 100644 --- a/tests/data/test1405 +++ b/tests/data/test1405 @@ -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 */ diff --git a/tests/data/test1406 b/tests/data/test1406 index 216d68e81..478e45ff3 100644 --- a/tests/data/test1406 +++ b/tests/data/test1406 @@ -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 */ diff --git a/tests/data/test1407 b/tests/data/test1407 index ab25a30a3..0b40a4732 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -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 */ -- cgit v1.2.3