aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-01-25 19:43:07 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-01-25 19:45:53 +0300
commitfa7e0ae04bb8460400033b2b31172701983635c5 (patch)
tree8cce78dfa9d68dfcdfaa03aa907a4fdb0dc42644
parentfc66711ad5b92067c758c807ac6210f808050767 (diff)
downloadlibmicrohttpd-fa7e0ae04bb8460400033b2b31172701983635c5.tar.gz
libmicrohttpd-fa7e0ae04bb8460400033b2b31172701983635c5.zip
mhd_panic: replaced direct function call with the macro
MHD_PANIC is generally used as a macro, but for some reason function was used directly in a few places.
-rw-r--r--src/microhttpd/connection.c10
-rw-r--r--src/microhttpd/digestauth.c5
-rw-r--r--src/microhttpd/postprocessor.c15
3 files changed, 6 insertions, 24 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 2490a1fb..21c4d338 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3323,15 +3323,7 @@ process_request_body (struct MHD_Connection *connection)
3323 return; 3323 return;
3324 } 3324 }
3325 if (left_unprocessed > to_be_processed) 3325 if (left_unprocessed > to_be_processed)
3326 mhd_panic (mhd_panic_cls, 3326 MHD_PANIC (_ ("libmicrohttpd API violation.\n"));
3327 __FILE__,
3328 __LINE__
3329#ifdef HAVE_MESSAGES
3330 , _ ("libmicrohttpd API violation.\n")
3331#else
3332 , NULL
3333#endif
3334 );
3335 if (0 != left_unprocessed) 3327 if (0 != left_unprocessed)
3336 { 3328 {
3337 instant_retry = false; /* client did not process everything */ 3329 instant_retry = false; /* client did not process everything */
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index 59f999f4..a1b7bcf4 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -83,9 +83,8 @@
83/** 83/**
84 * Check that @a n is below #MAX_DIGEST 84 * Check that @a n is below #MAX_DIGEST
85 */ 85 */
86#define VLA_CHECK_LEN_DIGEST(n) do { if ((n) > MAX_DIGEST) mhd_panic ( \ 86#define VLA_CHECK_LEN_DIGEST(n) \
87 mhd_panic_cls, __FILE__, __LINE__, \ 87 do { if ((n) > MAX_DIGEST) MHD_PANIC (_ ("VLA too big.\n")); } while (0)
88 "VLA too big.\n"); } while (0)
89 88
90 89
91/** 90/**
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
index 8556624d..0d6a00ab 100644
--- a/src/microhttpd/postprocessor.c
+++ b/src/microhttpd/postprocessor.c
@@ -266,10 +266,7 @@ MHD_create_post_processor (struct MHD_Connection *connection,
266 if ( (buffer_size < 256) || 266 if ( (buffer_size < 256) ||
267 (NULL == connection) || 267 (NULL == connection) ||
268 (NULL == iter)) 268 (NULL == iter))
269 mhd_panic (mhd_panic_cls, 269 MHD_PANIC (_ ("libmicrohttpd API violation.\n"));
270 __FILE__,
271 __LINE__,
272 NULL);
273 if (MHD_NO == MHD_lookup_connection_value_n (connection, 270 if (MHD_NO == MHD_lookup_connection_value_n (connection,
274 MHD_HEADER_KIND, 271 MHD_HEADER_KIND,
275 MHD_HTTP_HEADER_CONTENT_TYPE, 272 MHD_HTTP_HEADER_CONTENT_TYPE,
@@ -707,10 +704,7 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
707 pp->state = PP_Init; 704 pp->state = PP_Init;
708 break; 705 break;
709 default: 706 default:
710 mhd_panic (mhd_panic_cls, 707 MHD_PANIC (_ ("internal error.\n")); /* should never happen! */
711 __FILE__,
712 __LINE__,
713 NULL); /* should never happen! */
714 } 708 }
715 mhd_assert ((end_key == NULL) || (start_key != NULL)); 709 mhd_assert ((end_key == NULL) || (start_key != NULL));
716 mhd_assert ((end_value == NULL) || (start_value != NULL)); 710 mhd_assert ((end_value == NULL) || (start_value != NULL));
@@ -1431,10 +1425,7 @@ post_process_multipart (struct MHD_PostProcessor *pp,
1431 state_changed = 1; 1425 state_changed = 1;
1432 break; 1426 break;
1433 default: 1427 default:
1434 mhd_panic (mhd_panic_cls, 1428 MHD_PANIC (_ ("internal error.\n")); /* should never happen! */
1435 __FILE__,
1436 __LINE__,
1437 NULL); /* should never happen! */
1438 } 1429 }
1439AGAIN: 1430AGAIN:
1440 if (ioff > 0) 1431 if (ioff > 0)