diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-06-12 23:40:51 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-06-12 23:40:51 +0300 |
commit | b10f4140c68bd41ed600abf08b4990d79be598b4 (patch) | |
tree | 8e5e8e0d05d2957d759623f83dfe27032f332d74 /src/microhttpd | |
parent | 279a9ad2ab9f504264f3e1a671fc427a18079205 (diff) | |
download | libmicrohttpd-b10f4140c68bd41ed600abf08b4990d79be598b4.tar.gz libmicrohttpd-b10f4140c68bd41ed600abf08b4990d79be598b4.zip |
Use 'mhd_assert()'
Diffstat (limited to 'src/microhttpd')
-rw-r--r-- | src/microhttpd/connection.c | 56 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 12 | ||||
-rw-r--r-- | src/microhttpd/internal.h | 25 | ||||
-rw-r--r-- | src/microhttpd/response.c | 4 |
4 files changed, 46 insertions, 51 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index e8dd0752..3eb3cc3b 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -234,7 +234,7 @@ sendfile_adapter (struct MHD_Connection *connection) | |||
234 | #else /* HAVE_SENDFILE64 */ | 234 | #else /* HAVE_SENDFILE64 */ |
235 | off64_t offset; | 235 | off64_t offset; |
236 | #endif /* HAVE_SENDFILE64 */ | 236 | #endif /* HAVE_SENDFILE64 */ |
237 | EXTRA_CHECK (MHD_resp_sender_sendfile == connection->resp_sender); | 237 | mhd_assert (MHD_resp_sender_sendfile == connection->resp_sender); |
238 | 238 | ||
239 | offsetu64 = connection->response_write_position + connection->response->fd_off; | 239 | offsetu64 = connection->response_write_position + connection->response->fd_off; |
240 | left = connection->response->total_size - connection->response_write_position; | 240 | left = connection->response->total_size - connection->response_write_position; |
@@ -1065,8 +1065,8 @@ try_ready_chunked_body (struct MHD_Connection *connection) | |||
1065 | sizeof (cbuf), | 1065 | sizeof (cbuf), |
1066 | "%X\r\n", | 1066 | "%X\r\n", |
1067 | (unsigned int) ret); | 1067 | (unsigned int) ret); |
1068 | EXTRA_CHECK(cblen > 0); | 1068 | mhd_assert(cblen > 0); |
1069 | EXTRA_CHECK(cblen < sizeof(cbuf)); | 1069 | mhd_assert(cblen < sizeof(cbuf)); |
1070 | memcpy (&connection->write_buffer[sizeof (cbuf) - cblen], | 1070 | memcpy (&connection->write_buffer[sizeof (cbuf) - cblen], |
1071 | cbuf, | 1071 | cbuf, |
1072 | cblen); | 1072 | cblen); |
@@ -1264,7 +1264,7 @@ build_header_response (struct MHD_Connection *connection) | |||
1264 | int must_add_keep_alive; | 1264 | int must_add_keep_alive; |
1265 | int must_add_content_length; | 1265 | int must_add_content_length; |
1266 | 1266 | ||
1267 | EXTRA_CHECK (NULL != connection->version); | 1267 | mhd_assert (NULL != connection->version); |
1268 | if (0 == connection->version[0]) | 1268 | if (0 == connection->version[0]) |
1269 | { | 1269 | { |
1270 | data = MHD_pool_allocate (connection->pool, | 1270 | data = MHD_pool_allocate (connection->pool, |
@@ -1452,7 +1452,7 @@ build_header_response (struct MHD_Connection *connection) | |||
1452 | response_has_keepalive = false; | 1452 | response_has_keepalive = false; |
1453 | break; | 1453 | break; |
1454 | default: | 1454 | default: |
1455 | EXTRA_CHECK (0); | 1455 | mhd_assert (0); |
1456 | } | 1456 | } |
1457 | 1457 | ||
1458 | if (MHD_CONN_MUST_CLOSE != connection->keepalive) | 1458 | if (MHD_CONN_MUST_CLOSE != connection->keepalive) |
@@ -1471,8 +1471,8 @@ build_header_response (struct MHD_Connection *connection) | |||
1471 | size += MHD_STATICSTR_LEN_ ("Transfer-Encoding: chunked\r\n"); | 1471 | size += MHD_STATICSTR_LEN_ ("Transfer-Encoding: chunked\r\n"); |
1472 | if (must_add_content_length) | 1472 | if (must_add_content_length) |
1473 | size += content_length_len; | 1473 | size += content_length_len; |
1474 | EXTRA_CHECK (! (must_add_close && must_add_keep_alive) ); | 1474 | mhd_assert (! (must_add_close && must_add_keep_alive) ); |
1475 | EXTRA_CHECK (! (must_add_chunked_encoding && must_add_content_length) ); | 1475 | mhd_assert (! (must_add_chunked_encoding && must_add_content_length) ); |
1476 | 1476 | ||
1477 | for (pos = connection->response->first_header; NULL != pos; pos = pos->next) | 1477 | for (pos = connection->response->first_header; NULL != pos; pos = pos->next) |
1478 | { | 1478 | { |
@@ -1617,7 +1617,7 @@ transmit_error_response (struct MHD_Connection *connection, | |||
1617 | MHD_queue_response (connection, | 1617 | MHD_queue_response (connection, |
1618 | status_code, | 1618 | status_code, |
1619 | response); | 1619 | response); |
1620 | EXTRA_CHECK (NULL != connection->response); | 1620 | mhd_assert (NULL != connection->response); |
1621 | MHD_destroy_response (response); | 1621 | MHD_destroy_response (response); |
1622 | /* Do not reuse this connection. */ | 1622 | /* Do not reuse this connection. */ |
1623 | connection->keepalive = MHD_CONN_MUST_CLOSE; | 1623 | connection->keepalive = MHD_CONN_MUST_CLOSE; |
@@ -1698,10 +1698,10 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) | |||
1698 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK; | 1698 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK; |
1699 | break; | 1699 | break; |
1700 | case MHD_CONNECTION_HEADERS_RECEIVED: | 1700 | case MHD_CONNECTION_HEADERS_RECEIVED: |
1701 | EXTRA_CHECK (0); | 1701 | mhd_assert (0); |
1702 | break; | 1702 | break; |
1703 | case MHD_CONNECTION_HEADERS_PROCESSED: | 1703 | case MHD_CONNECTION_HEADERS_PROCESSED: |
1704 | EXTRA_CHECK (0); | 1704 | mhd_assert (0); |
1705 | break; | 1705 | break; |
1706 | case MHD_CONNECTION_CONTINUE_SENDING: | 1706 | case MHD_CONNECTION_CONTINUE_SENDING: |
1707 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; | 1707 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; |
@@ -1758,7 +1758,7 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) | |||
1758 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; | 1758 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; |
1759 | break; | 1759 | break; |
1760 | case MHD_CONNECTION_HEADERS_SENT: | 1760 | case MHD_CONNECTION_HEADERS_SENT: |
1761 | EXTRA_CHECK (0); | 1761 | mhd_assert (0); |
1762 | break; | 1762 | break; |
1763 | case MHD_CONNECTION_NORMAL_BODY_READY: | 1763 | case MHD_CONNECTION_NORMAL_BODY_READY: |
1764 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; | 1764 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; |
@@ -1773,27 +1773,27 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) | |||
1773 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK; | 1773 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_BLOCK; |
1774 | break; | 1774 | break; |
1775 | case MHD_CONNECTION_BODY_SENT: | 1775 | case MHD_CONNECTION_BODY_SENT: |
1776 | EXTRA_CHECK (0); | 1776 | mhd_assert (0); |
1777 | break; | 1777 | break; |
1778 | case MHD_CONNECTION_FOOTERS_SENDING: | 1778 | case MHD_CONNECTION_FOOTERS_SENDING: |
1779 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; | 1779 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; |
1780 | break; | 1780 | break; |
1781 | case MHD_CONNECTION_FOOTERS_SENT: | 1781 | case MHD_CONNECTION_FOOTERS_SENT: |
1782 | EXTRA_CHECK (0); | 1782 | mhd_assert (0); |
1783 | break; | 1783 | break; |
1784 | case MHD_CONNECTION_CLOSED: | 1784 | case MHD_CONNECTION_CLOSED: |
1785 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP; | 1785 | connection->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP; |
1786 | return; /* do nothing, not even reading */ | 1786 | return; /* do nothing, not even reading */ |
1787 | case MHD_CONNECTION_IN_CLEANUP: | 1787 | case MHD_CONNECTION_IN_CLEANUP: |
1788 | EXTRA_CHECK (0); | 1788 | mhd_assert (0); |
1789 | break; | 1789 | break; |
1790 | #ifdef UPGRADE_SUPPORT | 1790 | #ifdef UPGRADE_SUPPORT |
1791 | case MHD_CONNECTION_UPGRADE: | 1791 | case MHD_CONNECTION_UPGRADE: |
1792 | EXTRA_CHECK (0); | 1792 | mhd_assert (0); |
1793 | break; | 1793 | break; |
1794 | #endif /* UPGRADE_SUPPORT */ | 1794 | #endif /* UPGRADE_SUPPORT */ |
1795 | default: | 1795 | default: |
1796 | EXTRA_CHECK (0); | 1796 | mhd_assert (0); |
1797 | } | 1797 | } |
1798 | break; | 1798 | break; |
1799 | } | 1799 | } |
@@ -2505,7 +2505,7 @@ process_broken_line (struct MHD_Connection *connection, | |||
2505 | connection->last = last; | 2505 | connection->last = last; |
2506 | return MHD_YES; /* possibly more than 2 lines... */ | 2506 | return MHD_YES; /* possibly more than 2 lines... */ |
2507 | } | 2507 | } |
2508 | EXTRA_CHECK ( (NULL != last) && | 2508 | mhd_assert ( (NULL != last) && |
2509 | (NULL != connection->colon) ); | 2509 | (NULL != connection->colon) ); |
2510 | if ((MHD_NO == connection_add_header (connection, | 2510 | if ((MHD_NO == connection_add_header (connection, |
2511 | last, | 2511 | last, |
@@ -2565,7 +2565,7 @@ parse_connection_headers (struct MHD_Connection *connection) | |||
2565 | MHD_DLOG (connection->daemon, | 2565 | MHD_DLOG (connection->daemon, |
2566 | _("Received HTTP 1.1 request without `Host' header.\n")); | 2566 | _("Received HTTP 1.1 request without `Host' header.\n")); |
2567 | #endif | 2567 | #endif |
2568 | EXTRA_CHECK (NULL == connection->response); | 2568 | mhd_assert (NULL == connection->response); |
2569 | response = | 2569 | response = |
2570 | MHD_create_response_from_buffer (MHD_STATICSTR_LEN_ (REQUEST_LACKS_HOST), | 2570 | MHD_create_response_from_buffer (MHD_STATICSTR_LEN_ (REQUEST_LACKS_HOST), |
2571 | REQUEST_LACKS_HOST, | 2571 | REQUEST_LACKS_HOST, |
@@ -2745,7 +2745,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection) | |||
2745 | return; | 2745 | return; |
2746 | #ifdef UPGRADE_SUPPORT | 2746 | #ifdef UPGRADE_SUPPORT |
2747 | case MHD_CONNECTION_UPGRADE: | 2747 | case MHD_CONNECTION_UPGRADE: |
2748 | EXTRA_CHECK (0); | 2748 | mhd_assert (0); |
2749 | return; | 2749 | return; |
2750 | #endif /* UPGRADE_SUPPORT */ | 2750 | #endif /* UPGRADE_SUPPORT */ |
2751 | default: | 2751 | default: |
@@ -2797,7 +2797,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
2797 | case MHD_CONNECTION_URL_RECEIVED: | 2797 | case MHD_CONNECTION_URL_RECEIVED: |
2798 | case MHD_CONNECTION_HEADER_PART_RECEIVED: | 2798 | case MHD_CONNECTION_HEADER_PART_RECEIVED: |
2799 | case MHD_CONNECTION_HEADERS_RECEIVED: | 2799 | case MHD_CONNECTION_HEADERS_RECEIVED: |
2800 | EXTRA_CHECK (0); | 2800 | mhd_assert (0); |
2801 | return; | 2801 | return; |
2802 | case MHD_CONNECTION_HEADERS_PROCESSED: | 2802 | case MHD_CONNECTION_HEADERS_PROCESSED: |
2803 | return; | 2803 | return; |
@@ -2833,7 +2833,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
2833 | case MHD_CONNECTION_BODY_RECEIVED: | 2833 | case MHD_CONNECTION_BODY_RECEIVED: |
2834 | case MHD_CONNECTION_FOOTER_PART_RECEIVED: | 2834 | case MHD_CONNECTION_FOOTER_PART_RECEIVED: |
2835 | case MHD_CONNECTION_FOOTERS_RECEIVED: | 2835 | case MHD_CONNECTION_FOOTERS_RECEIVED: |
2836 | EXTRA_CHECK (0); | 2836 | mhd_assert (0); |
2837 | return; | 2837 | return; |
2838 | case MHD_CONNECTION_HEADERS_SENDING: | 2838 | case MHD_CONNECTION_HEADERS_SENDING: |
2839 | ret = connection->send_cls (connection, | 2839 | ret = connection->send_cls (connection, |
@@ -2924,7 +2924,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
2924 | connection->state = MHD_CONNECTION_FOOTERS_SENT; /* have no footers */ | 2924 | connection->state = MHD_CONNECTION_FOOTERS_SENT; /* have no footers */ |
2925 | return; | 2925 | return; |
2926 | case MHD_CONNECTION_NORMAL_BODY_UNREADY: | 2926 | case MHD_CONNECTION_NORMAL_BODY_UNREADY: |
2927 | EXTRA_CHECK (0); | 2927 | mhd_assert (0); |
2928 | return; | 2928 | return; |
2929 | case MHD_CONNECTION_CHUNKED_BODY_READY: | 2929 | case MHD_CONNECTION_CHUNKED_BODY_READY: |
2930 | ret = connection->send_cls (connection, | 2930 | ret = connection->send_cls (connection, |
@@ -2952,7 +2952,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
2952 | return; | 2952 | return; |
2953 | case MHD_CONNECTION_CHUNKED_BODY_UNREADY: | 2953 | case MHD_CONNECTION_CHUNKED_BODY_UNREADY: |
2954 | case MHD_CONNECTION_BODY_SENT: | 2954 | case MHD_CONNECTION_BODY_SENT: |
2955 | EXTRA_CHECK (0); | 2955 | mhd_assert (0); |
2956 | return; | 2956 | return; |
2957 | case MHD_CONNECTION_FOOTERS_SENDING: | 2957 | case MHD_CONNECTION_FOOTERS_SENDING: |
2958 | ret = connection->send_cls (connection, | 2958 | ret = connection->send_cls (connection, |
@@ -2976,20 +2976,20 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
2976 | MHD_CONNECTION_FOOTERS_SENT); | 2976 | MHD_CONNECTION_FOOTERS_SENT); |
2977 | return; | 2977 | return; |
2978 | case MHD_CONNECTION_FOOTERS_SENT: | 2978 | case MHD_CONNECTION_FOOTERS_SENT: |
2979 | EXTRA_CHECK (0); | 2979 | mhd_assert (0); |
2980 | return; | 2980 | return; |
2981 | case MHD_CONNECTION_CLOSED: | 2981 | case MHD_CONNECTION_CLOSED: |
2982 | return; | 2982 | return; |
2983 | case MHD_CONNECTION_IN_CLEANUP: | 2983 | case MHD_CONNECTION_IN_CLEANUP: |
2984 | EXTRA_CHECK (0); | 2984 | mhd_assert (0); |
2985 | return; | 2985 | return; |
2986 | #ifdef UPGRADE_SUPPORT | 2986 | #ifdef UPGRADE_SUPPORT |
2987 | case MHD_CONNECTION_UPGRADE: | 2987 | case MHD_CONNECTION_UPGRADE: |
2988 | EXTRA_CHECK (0); | 2988 | mhd_assert (0); |
2989 | return; | 2989 | return; |
2990 | #endif /* UPGRADE_SUPPORT */ | 2990 | #endif /* UPGRADE_SUPPORT */ |
2991 | default: | 2991 | default: |
2992 | EXTRA_CHECK (0); | 2992 | mhd_assert (0); |
2993 | CONNECTION_CLOSE_ERROR (connection, | 2993 | CONNECTION_CLOSE_ERROR (connection, |
2994 | _("Internal error\n")); | 2994 | _("Internal error\n")); |
2995 | break; | 2995 | break; |
@@ -3544,7 +3544,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
3544 | return MHD_YES; /* keep open */ | 3544 | return MHD_YES; /* keep open */ |
3545 | #endif /* UPGRADE_SUPPORT */ | 3545 | #endif /* UPGRADE_SUPPORT */ |
3546 | default: | 3546 | default: |
3547 | EXTRA_CHECK (0); | 3547 | mhd_assert (0); |
3548 | break; | 3548 | break; |
3549 | } | 3549 | } |
3550 | break; | 3550 | break; |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index cb7064a4..f2d4f73b 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -2081,7 +2081,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
2081 | int eno = 0; | 2081 | int eno = 0; |
2082 | 2082 | ||
2083 | /* Direct add to master daemon could happen only with "external" add mode. */ | 2083 | /* Direct add to master daemon could happen only with "external" add mode. */ |
2084 | EXTRA_CHECK ((NULL == daemon->worker_pool) || (external_add)); | 2084 | mhd_assert ((NULL == daemon->worker_pool) || (external_add)); |
2085 | if ((external_add) && (NULL != daemon->worker_pool)) | 2085 | if ((external_add) && (NULL != daemon->worker_pool)) |
2086 | { | 2086 | { |
2087 | /* have a pool, try to find a pool with capacity; we use the | 2087 | /* have a pool, try to find a pool with capacity; we use the |
@@ -2475,7 +2475,7 @@ internal_suspend_connection_ (struct MHD_Connection *connection) | |||
2475 | DLL_remove (daemon->connections_head, | 2475 | DLL_remove (daemon->connections_head, |
2476 | daemon->connections_tail, | 2476 | daemon->connections_tail, |
2477 | connection); | 2477 | connection); |
2478 | EXTRA_CHECK (! connection->suspended); | 2478 | mhd_assert (! connection->suspended); |
2479 | DLL_insert (daemon->suspended_connections_head, | 2479 | DLL_insert (daemon->suspended_connections_head, |
2480 | daemon->suspended_connections_tail, | 2480 | daemon->suspended_connections_tail, |
2481 | connection); | 2481 | connection); |
@@ -2612,7 +2612,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon) | |||
2612 | if (daemon->resuming) | 2612 | if (daemon->resuming) |
2613 | prev = daemon->suspended_connections_tail; | 2613 | prev = daemon->suspended_connections_tail; |
2614 | 2614 | ||
2615 | EXTRA_CHECK(NULL != next); | 2615 | mhd_assert(NULL != prev); |
2616 | daemon->resuming = false; | 2616 | daemon->resuming = false; |
2617 | 2617 | ||
2618 | while (NULL != (pos = prev)) | 2618 | while (NULL != (pos = prev)) |
@@ -2632,7 +2632,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon) | |||
2632 | ) | 2632 | ) |
2633 | continue; | 2633 | continue; |
2634 | ret = MHD_YES; | 2634 | ret = MHD_YES; |
2635 | EXTRA_CHECK (pos->suspended); | 2635 | mhd_assert (pos->suspended); |
2636 | DLL_remove (daemon->suspended_connections_head, | 2636 | DLL_remove (daemon->suspended_connections_head, |
2637 | daemon->suspended_connections_tail, | 2637 | daemon->suspended_connections_tail, |
2638 | pos); | 2638 | pos); |
@@ -4266,8 +4266,8 @@ close_connection (struct MHD_Connection *pos) | |||
4266 | 4266 | ||
4267 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 4267 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
4268 | 4268 | ||
4269 | EXTRA_CHECK (! pos->suspended); | 4269 | mhd_assert (! pos->suspended); |
4270 | EXTRA_CHECK (! pos->resuming); | 4270 | mhd_assert (! pos->resuming); |
4271 | if (pos->connection_timeout == pos->daemon->connection_timeout) | 4271 | if (pos->connection_timeout == pos->daemon->connection_timeout) |
4272 | XDLL_remove (daemon->normal_timeout_head, | 4272 | XDLL_remove (daemon->normal_timeout_head, |
4273 | daemon->normal_timeout_tail, | 4273 | daemon->normal_timeout_tail, |
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 7a47651e..85fe2487 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #include "mhd_options.h" | 30 | #include "mhd_options.h" |
31 | #include "platform.h" | 31 | #include "platform.h" |
32 | #include "microhttpd.h" | 32 | #include "microhttpd.h" |
33 | #include "mhd_assert.h" | ||
34 | |||
33 | #ifdef HTTPS_SUPPORT | 35 | #ifdef HTTPS_SUPPORT |
34 | #include <gnutls/gnutls.h> | 36 | #include <gnutls/gnutls.h> |
35 | #if GNUTLS_VERSION_MAJOR >= 3 | 37 | #if GNUTLS_VERSION_MAJOR >= 3 |
@@ -1697,13 +1699,6 @@ struct MHD_Daemon | |||
1697 | }; | 1699 | }; |
1698 | 1700 | ||
1699 | 1701 | ||
1700 | #if EXTRA_CHECKS | ||
1701 | #define EXTRA_CHECK(a) do { if (!(a)) abort(); } while (0) | ||
1702 | #else | ||
1703 | #define EXTRA_CHECK(a) | ||
1704 | #endif | ||
1705 | |||
1706 | |||
1707 | /** | 1702 | /** |
1708 | * Insert an element at the head of a DLL. Assumes that head, tail and | 1703 | * Insert an element at the head of a DLL. Assumes that head, tail and |
1709 | * element are structs with prev and next fields. | 1704 | * element are structs with prev and next fields. |
@@ -1713,8 +1708,8 @@ struct MHD_Daemon | |||
1713 | * @param element element to insert | 1708 | * @param element element to insert |
1714 | */ | 1709 | */ |
1715 | #define DLL_insert(head,tail,element) do { \ | 1710 | #define DLL_insert(head,tail,element) do { \ |
1716 | EXTRA_CHECK (NULL == (element)->next); \ | 1711 | mhd_assert (NULL == (element)->next); \ |
1717 | EXTRA_CHECK (NULL == (element)->prev); \ | 1712 | mhd_assert (NULL == (element)->prev); \ |
1718 | (element)->next = (head); \ | 1713 | (element)->next = (head); \ |
1719 | (element)->prev = NULL; \ | 1714 | (element)->prev = NULL; \ |
1720 | if ((tail) == NULL) \ | 1715 | if ((tail) == NULL) \ |
@@ -1734,8 +1729,8 @@ struct MHD_Daemon | |||
1734 | * @param element element to remove | 1729 | * @param element element to remove |
1735 | */ | 1730 | */ |
1736 | #define DLL_remove(head,tail,element) do { \ | 1731 | #define DLL_remove(head,tail,element) do { \ |
1737 | EXTRA_CHECK ( (NULL != (element)->next) || ((element) == (tail))); \ | 1732 | mhd_assert ( (NULL != (element)->next) || ((element) == (tail))); \ |
1738 | EXTRA_CHECK ( (NULL != (element)->prev) || ((element) == (head))); \ | 1733 | mhd_assert ( (NULL != (element)->prev) || ((element) == (head))); \ |
1739 | if ((element)->prev == NULL) \ | 1734 | if ((element)->prev == NULL) \ |
1740 | (head) = (element)->next; \ | 1735 | (head) = (element)->next; \ |
1741 | else \ | 1736 | else \ |
@@ -1758,8 +1753,8 @@ struct MHD_Daemon | |||
1758 | * @param element element to insert | 1753 | * @param element element to insert |
1759 | */ | 1754 | */ |
1760 | #define XDLL_insert(head,tail,element) do { \ | 1755 | #define XDLL_insert(head,tail,element) do { \ |
1761 | EXTRA_CHECK (NULL == (element)->nextX); \ | 1756 | mhd_assert (NULL == (element)->nextX); \ |
1762 | EXTRA_CHECK (NULL == (element)->prevX); \ | 1757 | mhd_assert (NULL == (element)->prevX); \ |
1763 | (element)->nextX = (head); \ | 1758 | (element)->nextX = (head); \ |
1764 | (element)->prevX = NULL; \ | 1759 | (element)->prevX = NULL; \ |
1765 | if (NULL == (tail)) \ | 1760 | if (NULL == (tail)) \ |
@@ -1779,8 +1774,8 @@ struct MHD_Daemon | |||
1779 | * @param element element to remove | 1774 | * @param element element to remove |
1780 | */ | 1775 | */ |
1781 | #define XDLL_remove(head,tail,element) do { \ | 1776 | #define XDLL_remove(head,tail,element) do { \ |
1782 | EXTRA_CHECK ( (NULL != (element)->nextX) || ((element) == (tail))); \ | 1777 | mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail))); \ |
1783 | EXTRA_CHECK ( (NULL != (element)->prevX) || ((element) == (head))); \ | 1778 | mhd_assert ( (NULL != (element)->prevX) || ((element) == (head))); \ |
1784 | if (NULL == (element)->prevX) \ | 1779 | if (NULL == (element)->prevX) \ |
1785 | (head) = (element)->nextX; \ | 1780 | (head) = (element)->nextX; \ |
1786 | else \ | 1781 | else \ |
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index 7b2b4eb7..a0ecf3ea 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -714,7 +714,7 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, | |||
714 | SHUT_RDWR); | 714 | SHUT_RDWR); |
715 | } | 715 | } |
716 | #endif /* HTTPS_SUPPORT */ | 716 | #endif /* HTTPS_SUPPORT */ |
717 | EXTRA_CHECK (MHD_CONNECTION_UPGRADE == connection->state); | 717 | mhd_assert (MHD_CONNECTION_UPGRADE == connection->state); |
718 | urh->was_closed = true; | 718 | urh->was_closed = true; |
719 | /* As soon as connection will be marked with BOTH | 719 | /* As soon as connection will be marked with BOTH |
720 | * 'urh->was_closed' AND 'urh->clean_ready', it will | 720 | * 'urh->was_closed' AND 'urh->clean_ready', it will |
@@ -885,7 +885,7 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
885 | to the event set of the daemon's `epoll_upgrade_fd` */ | 885 | to the event set of the daemon's `epoll_upgrade_fd` */ |
886 | struct epoll_event event; | 886 | struct epoll_event event; |
887 | 887 | ||
888 | EXTRA_CHECK (-1 != daemon->epoll_upgrade_fd); | 888 | mhd_assert (-1 != daemon->epoll_upgrade_fd); |
889 | /* First, add network socket */ | 889 | /* First, add network socket */ |
890 | event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET; | 890 | event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET; |
891 | event.data.ptr = &urh->app; | 891 | event.data.ptr = &urh->app; |