aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-04-19 13:38:16 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-04-19 13:38:16 +0300
commitff842eabd8d6de36242d88b1ded314282d04f5ad (patch)
tree084d335c470f4035d9093602fd8ffc07d7deb817 /src
parente53b8c0b2898d16997be6037c308846c561073a0 (diff)
downloadlibmicrohttpd-ff842eabd8d6de36242d88b1ded314282d04f5ad.tar.gz
libmicrohttpd-ff842eabd8d6de36242d88b1ded314282d04f5ad.zip
testzzuf: print wrong callback parameters values
Diffstat (limited to 'src')
-rw-r--r--src/testzzuf/test_get.c10
-rw-r--r--src/testzzuf/test_get_chunked.c10
-rw-r--r--src/testzzuf/test_long_header.c10
-rw-r--r--src/testzzuf/test_post.c10
-rw-r--r--src/testzzuf/test_post_form.c10
-rw-r--r--src/testzzuf/test_put.c10
-rw-r--r--src/testzzuf/test_put_chunked.c10
-rw-r--r--src/testzzuf/test_put_large.c10
8 files changed, 80 insertions, 0 deletions
diff --git a/src/testzzuf/test_get.c b/src/testzzuf/test_get.c
index 9ef0d4f7..0ab4fcf9 100644
--- a/src/testzzuf/test_get.c
+++ b/src/testzzuf/test_get.c
@@ -75,6 +75,16 @@ ahc_echo (void *cls,
75 enum MHD_Result ret; 75 enum MHD_Result ret;
76 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 76 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
77 77
78 if (NULL == url)
79 fprintf (stderr, "The \"url\" parameter is NULL.\n");
80 if (NULL == method)
81 fprintf (stderr, "The \"method\" parameter is NULL.\n");
82 if (NULL == version)
83 fprintf (stderr, "The \"version\" parameter is NULL.\n");
84 if (NULL == upload_data_size)
85 fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n");
86 if ((0 != *upload_data_size) && (NULL == upload_data))
87 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
78 if (0 != strcmp (me, method)) 88 if (0 != strcmp (me, method))
79 return MHD_NO; /* unexpected method */ 89 return MHD_NO; /* unexpected method */
80 if (&ptr != *unused) 90 if (&ptr != *unused)
diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c
index ed974828..9fdab22a 100644
--- a/src/testzzuf/test_get_chunked.c
+++ b/src/testzzuf/test_get_chunked.c
@@ -108,6 +108,16 @@ ahc_echo (void *cls,
108 (void) upload_data; 108 (void) upload_data;
109 (void) upload_data_size; /* Unused. Silent compiler warning. */ 109 (void) upload_data_size; /* Unused. Silent compiler warning. */
110 110
111 if (NULL == url)
112 fprintf (stderr, "The \"url\" parameter is NULL.\n");
113 if (NULL == method)
114 fprintf (stderr, "The \"method\" parameter is NULL.\n");
115 if (NULL == version)
116 fprintf (stderr, "The \"version\" parameter is NULL.\n");
117 if (NULL == upload_data_size)
118 fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n");
119 if ((0 != *upload_data_size) && (NULL == upload_data))
120 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
111 if (0 != strcmp (me, method)) 121 if (0 != strcmp (me, method))
112 return MHD_NO; /* unexpected method */ 122 return MHD_NO; /* unexpected method */
113 if (&aptr != *ptr) 123 if (&aptr != *ptr)
diff --git a/src/testzzuf/test_long_header.c b/src/testzzuf/test_long_header.c
index f62fe07b..ac53bad6 100644
--- a/src/testzzuf/test_long_header.c
+++ b/src/testzzuf/test_long_header.c
@@ -85,6 +85,16 @@ ahc_echo (void *cls,
85 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 85 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
86 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 86 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */
87 87
88 if (NULL == url)
89 fprintf (stderr, "The \"url\" parameter is NULL.\n");
90 if (NULL == method)
91 fprintf (stderr, "The \"method\" parameter is NULL.\n");
92 if (NULL == version)
93 fprintf (stderr, "The \"version\" parameter is NULL.\n");
94 if (NULL == upload_data_size)
95 fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n");
96 if ((0 != *upload_data_size) && (NULL == upload_data))
97 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
88 if (0 != strcmp (me, method)) 98 if (0 != strcmp (me, method))
89 return MHD_NO; /* unexpected method */ 99 return MHD_NO; /* unexpected method */
90 response = MHD_create_response_from_buffer (strlen (url), 100 response = MHD_create_response_from_buffer (strlen (url),
diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c
index e3d8512c..8377af06 100644
--- a/src/testzzuf/test_post.c
+++ b/src/testzzuf/test_post.c
@@ -122,6 +122,16 @@ ahc_echo (void *cls,
122 enum MHD_Result ret; 122 enum MHD_Result ret;
123 (void) cls; (void) version; /* Unused. Silent compiler warning. */ 123 (void) cls; (void) version; /* Unused. Silent compiler warning. */
124 124
125 if (NULL == url)
126 fprintf (stderr, "The \"url\" parameter is NULL.\n");
127 if (NULL == method)
128 fprintf (stderr, "The \"method\" parameter is NULL.\n");
129 if (NULL == version)
130 fprintf (stderr, "The \"version\" parameter is NULL.\n");
131 if (NULL == upload_data_size)
132 fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n");
133 if ((0 != *upload_data_size) && (NULL == upload_data))
134 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
125 if (0 != strcmp ("POST", method)) 135 if (0 != strcmp ("POST", method))
126 { 136 {
127 return MHD_NO; /* unexpected method */ 137 return MHD_NO; /* unexpected method */
diff --git a/src/testzzuf/test_post_form.c b/src/testzzuf/test_post_form.c
index f994ab24..85a5d3d7 100644
--- a/src/testzzuf/test_post_form.c
+++ b/src/testzzuf/test_post_form.c
@@ -125,6 +125,16 @@ ahc_echo (void *cls,
125 enum MHD_Result ret; 125 enum MHD_Result ret;
126 (void) cls; (void) version; /* Unused. Silent compiler warning. */ 126 (void) cls; (void) version; /* Unused. Silent compiler warning. */
127 127
128 if (NULL == url)
129 fprintf (stderr, "The \"url\" parameter is NULL.\n");
130 if (NULL == method)
131 fprintf (stderr, "The \"method\" parameter is NULL.\n");
132 if (NULL == version)
133 fprintf (stderr, "The \"version\" parameter is NULL.\n");
134 if (NULL == upload_data_size)
135 fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n");
136 if ((0 != *upload_data_size) && (NULL == upload_data))
137 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
128 if (0 != strcmp ("POST", method)) 138 if (0 != strcmp ("POST", method))
129 { 139 {
130 return MHD_NO; /* unexpected method */ 140 return MHD_NO; /* unexpected method */
diff --git a/src/testzzuf/test_put.c b/src/testzzuf/test_put.c
index 4658d0d4..86f7b63a 100644
--- a/src/testzzuf/test_put.c
+++ b/src/testzzuf/test_put.c
@@ -90,6 +90,16 @@ ahc_echo (void *cls,
90 enum MHD_Result ret; 90 enum MHD_Result ret;
91 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 91 (void) version; (void) unused; /* Unused. Silent compiler warning. */
92 92
93 if (NULL == url)
94 fprintf (stderr, "The \"url\" parameter is NULL.\n");
95 if (NULL == method)
96 fprintf (stderr, "The \"method\" parameter is NULL.\n");
97 if (NULL == version)
98 fprintf (stderr, "The \"version\" parameter is NULL.\n");
99 if (NULL == upload_data_size)
100 fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n");
101 if ((0 != *upload_data_size) && (NULL == upload_data))
102 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
93 if (0 != strcmp ("PUT", method)) 103 if (0 != strcmp ("PUT", method))
94 return MHD_NO; /* unexpected method */ 104 return MHD_NO; /* unexpected method */
95 if ((*done) == 0) 105 if ((*done) == 0)
diff --git a/src/testzzuf/test_put_chunked.c b/src/testzzuf/test_put_chunked.c
index 35196843..c762c27b 100644
--- a/src/testzzuf/test_put_chunked.c
+++ b/src/testzzuf/test_put_chunked.c
@@ -91,6 +91,16 @@ ahc_echo (void *cls,
91 int have; 91 int have;
92 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 92 (void) version; (void) unused; /* Unused. Silent compiler warning. */
93 93
94 if (NULL == url)
95 fprintf (stderr, "The \"url\" parameter is NULL.\n");
96 if (NULL == method)
97 fprintf (stderr, "The \"method\" parameter is NULL.\n");
98 if (NULL == version)
99 fprintf (stderr, "The \"version\" parameter is NULL.\n");
100 if (NULL == upload_data_size)
101 fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n");
102 if ((0 != *upload_data_size) && (NULL == upload_data))
103 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
94 if (0 != strcmp ("PUT", method)) 104 if (0 != strcmp ("PUT", method))
95 return MHD_NO; /* unexpected method */ 105 return MHD_NO; /* unexpected method */
96 if ((*done) < 8) 106 if ((*done) < 8)
diff --git a/src/testzzuf/test_put_large.c b/src/testzzuf/test_put_large.c
index abda22cb..3a3d7fb0 100644
--- a/src/testzzuf/test_put_large.c
+++ b/src/testzzuf/test_put_large.c
@@ -98,6 +98,16 @@ ahc_echo (void *cls,
98 enum MHD_Result ret; 98 enum MHD_Result ret;
99 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 99 (void) version; (void) unused; /* Unused. Silent compiler warning. */
100 100
101 if (NULL == url)
102 fprintf (stderr, "The \"url\" parameter is NULL.\n");
103 if (NULL == method)
104 fprintf (stderr, "The \"method\" parameter is NULL.\n");
105 if (NULL == version)
106 fprintf (stderr, "The \"version\" parameter is NULL.\n");
107 if (NULL == upload_data_size)
108 fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n");
109 if ((0 != *upload_data_size) && (NULL == upload_data))
110 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
101 if (0 != strcmp ("PUT", method)) 111 if (0 != strcmp ("PUT", method))
102 return MHD_NO; /* unexpected method */ 112 return MHD_NO; /* unexpected method */
103 if ((*done) == 0) 113 if ((*done) == 0)