libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit ff842eabd8d6de36242d88b1ded314282d04f5ad
parent e53b8c0b2898d16997be6037c308846c561073a0
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Mon, 19 Apr 2021 13:38:16 +0300

testzzuf: print wrong callback parameters values

Diffstat:
Msrc/testzzuf/test_get.c | 10++++++++++
Msrc/testzzuf/test_get_chunked.c | 10++++++++++
Msrc/testzzuf/test_long_header.c | 10++++++++++
Msrc/testzzuf/test_post.c | 10++++++++++
Msrc/testzzuf/test_post_form.c | 10++++++++++
Msrc/testzzuf/test_put.c | 10++++++++++
Msrc/testzzuf/test_put_chunked.c | 10++++++++++
Msrc/testzzuf/test_put_large.c | 10++++++++++
8 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/src/testzzuf/test_get.c b/src/testzzuf/test_get.c @@ -75,6 +75,16 @@ ahc_echo (void *cls, enum MHD_Result ret; (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ + if (NULL == url) + fprintf (stderr, "The \"url\" parameter is NULL.\n"); + if (NULL == method) + fprintf (stderr, "The \"method\" parameter is NULL.\n"); + if (NULL == version) + fprintf (stderr, "The \"version\" parameter is NULL.\n"); + if (NULL == upload_data_size) + fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n"); + if ((0 != *upload_data_size) && (NULL == upload_data)) + fprintf (stderr, "Upload data is NULL with non-zero size.\n"); if (0 != strcmp (me, method)) return MHD_NO; /* unexpected method */ if (&ptr != *unused) diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c @@ -108,6 +108,16 @@ ahc_echo (void *cls, (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ + if (NULL == url) + fprintf (stderr, "The \"url\" parameter is NULL.\n"); + if (NULL == method) + fprintf (stderr, "The \"method\" parameter is NULL.\n"); + if (NULL == version) + fprintf (stderr, "The \"version\" parameter is NULL.\n"); + if (NULL == upload_data_size) + fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n"); + if ((0 != *upload_data_size) && (NULL == upload_data)) + fprintf (stderr, "Upload data is NULL with non-zero size.\n"); if (0 != strcmp (me, method)) return MHD_NO; /* unexpected method */ if (&aptr != *ptr) diff --git a/src/testzzuf/test_long_header.c b/src/testzzuf/test_long_header.c @@ -85,6 +85,16 @@ ahc_echo (void *cls, (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ + if (NULL == url) + fprintf (stderr, "The \"url\" parameter is NULL.\n"); + if (NULL == method) + fprintf (stderr, "The \"method\" parameter is NULL.\n"); + if (NULL == version) + fprintf (stderr, "The \"version\" parameter is NULL.\n"); + if (NULL == upload_data_size) + fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n"); + if ((0 != *upload_data_size) && (NULL == upload_data)) + fprintf (stderr, "Upload data is NULL with non-zero size.\n"); if (0 != strcmp (me, method)) return MHD_NO; /* unexpected method */ response = MHD_create_response_from_buffer (strlen (url), diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c @@ -122,6 +122,16 @@ ahc_echo (void *cls, enum MHD_Result ret; (void) cls; (void) version; /* Unused. Silent compiler warning. */ + if (NULL == url) + fprintf (stderr, "The \"url\" parameter is NULL.\n"); + if (NULL == method) + fprintf (stderr, "The \"method\" parameter is NULL.\n"); + if (NULL == version) + fprintf (stderr, "The \"version\" parameter is NULL.\n"); + if (NULL == upload_data_size) + fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n"); + if ((0 != *upload_data_size) && (NULL == upload_data)) + fprintf (stderr, "Upload data is NULL with non-zero size.\n"); if (0 != strcmp ("POST", method)) { return MHD_NO; /* unexpected method */ diff --git a/src/testzzuf/test_post_form.c b/src/testzzuf/test_post_form.c @@ -125,6 +125,16 @@ ahc_echo (void *cls, enum MHD_Result ret; (void) cls; (void) version; /* Unused. Silent compiler warning. */ + if (NULL == url) + fprintf (stderr, "The \"url\" parameter is NULL.\n"); + if (NULL == method) + fprintf (stderr, "The \"method\" parameter is NULL.\n"); + if (NULL == version) + fprintf (stderr, "The \"version\" parameter is NULL.\n"); + if (NULL == upload_data_size) + fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n"); + if ((0 != *upload_data_size) && (NULL == upload_data)) + fprintf (stderr, "Upload data is NULL with non-zero size.\n"); if (0 != strcmp ("POST", method)) { return MHD_NO; /* unexpected method */ diff --git a/src/testzzuf/test_put.c b/src/testzzuf/test_put.c @@ -90,6 +90,16 @@ ahc_echo (void *cls, enum MHD_Result ret; (void) version; (void) unused; /* Unused. Silent compiler warning. */ + if (NULL == url) + fprintf (stderr, "The \"url\" parameter is NULL.\n"); + if (NULL == method) + fprintf (stderr, "The \"method\" parameter is NULL.\n"); + if (NULL == version) + fprintf (stderr, "The \"version\" parameter is NULL.\n"); + if (NULL == upload_data_size) + fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n"); + if ((0 != *upload_data_size) && (NULL == upload_data)) + fprintf (stderr, "Upload data is NULL with non-zero size.\n"); if (0 != strcmp ("PUT", method)) return MHD_NO; /* unexpected method */ if ((*done) == 0) diff --git a/src/testzzuf/test_put_chunked.c b/src/testzzuf/test_put_chunked.c @@ -91,6 +91,16 @@ ahc_echo (void *cls, int have; (void) version; (void) unused; /* Unused. Silent compiler warning. */ + if (NULL == url) + fprintf (stderr, "The \"url\" parameter is NULL.\n"); + if (NULL == method) + fprintf (stderr, "The \"method\" parameter is NULL.\n"); + if (NULL == version) + fprintf (stderr, "The \"version\" parameter is NULL.\n"); + if (NULL == upload_data_size) + fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n"); + if ((0 != *upload_data_size) && (NULL == upload_data)) + fprintf (stderr, "Upload data is NULL with non-zero size.\n"); if (0 != strcmp ("PUT", method)) return MHD_NO; /* unexpected method */ if ((*done) < 8) diff --git a/src/testzzuf/test_put_large.c b/src/testzzuf/test_put_large.c @@ -98,6 +98,16 @@ ahc_echo (void *cls, enum MHD_Result ret; (void) version; (void) unused; /* Unused. Silent compiler warning. */ + if (NULL == url) + fprintf (stderr, "The \"url\" parameter is NULL.\n"); + if (NULL == method) + fprintf (stderr, "The \"method\" parameter is NULL.\n"); + if (NULL == version) + fprintf (stderr, "The \"version\" parameter is NULL.\n"); + if (NULL == upload_data_size) + fprintf (stderr, "The \"upload_data_size\" parameter is NULL.\n"); + if ((0 != *upload_data_size) && (NULL == upload_data)) + fprintf (stderr, "Upload data is NULL with non-zero size.\n"); if (0 != strcmp ("PUT", method)) return MHD_NO; /* unexpected method */ if ((*done) == 0)