diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-10-11 15:20:40 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-10-11 15:20:40 +0000 |
commit | a8948d201be986112a2a616b2ff30e58e8a8f08f (patch) | |
tree | cf8211f0691aa1a1f6f40b6e051b5be6ddd9dfae /src/microhttpd/response.c | |
parent | 3675d8e5a77e91147a14da7bdbbdcc9fe6a3b5d6 (diff) | |
download | libmicrohttpd-a8948d201be986112a2a616b2ff30e58e8a8f08f.tar.gz libmicrohttpd-a8948d201be986112a2a616b2ff30e58e8a8f08f.zip |
Refactored mhd_locks.h and mhd_sockets.h: allow usage of macros without
aborting of execution.
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r-- | src/microhttpd/response.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index 3e4040c4..b06e268d 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -568,7 +568,7 @@ MHD_create_response_from_data (size_t size, | |||
568 | { | 568 | { |
569 | if (NULL == (tmp = malloc (size))) | 569 | if (NULL == (tmp = malloc (size))) |
570 | { | 570 | { |
571 | MHD_mutex_destroy_ (&response->mutex); | 571 | MHD_mutex_destroy_chk_ (&response->mutex); |
572 | free (response); | 572 | free (response); |
573 | return NULL; | 573 | return NULL; |
574 | } | 574 | } |
@@ -655,7 +655,7 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, | |||
655 | urh->was_closed = MHD_YES; | 655 | urh->was_closed = MHD_YES; |
656 | if (MHD_INVALID_SOCKET != urh->app.socket) | 656 | if (MHD_INVALID_SOCKET != urh->app.socket) |
657 | { | 657 | { |
658 | MHD_socket_close_ (urh->app.socket); | 658 | MHD_socket_close_chk_ (urh->app.socket); |
659 | urh->app.socket = MHD_INVALID_SOCKET; | 659 | urh->app.socket = MHD_INVALID_SOCKET; |
660 | } | 660 | } |
661 | return MHD_YES; | 661 | return MHD_YES; |
@@ -742,8 +742,8 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
742 | (int) sv[1], | 742 | (int) sv[1], |
743 | (int) FD_SETSIZE); | 743 | (int) FD_SETSIZE); |
744 | #endif | 744 | #endif |
745 | MHD_socket_close_ (sv[0]); | 745 | MHD_socket_close_chk_ (sv[0]); |
746 | MHD_socket_close_ (sv[1]); | 746 | MHD_socket_close_chk_ (sv[1]); |
747 | free (urh); | 747 | free (urh); |
748 | return MHD_NO; | 748 | return MHD_NO; |
749 | } | 749 | } |
@@ -814,8 +814,8 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
814 | _("Call to epoll_ctl failed: %s\n"), | 814 | _("Call to epoll_ctl failed: %s\n"), |
815 | MHD_socket_last_strerr_ ()); | 815 | MHD_socket_last_strerr_ ()); |
816 | #endif | 816 | #endif |
817 | MHD_socket_close_ (sv[0]); | 817 | MHD_socket_close_chk_ (sv[0]); |
818 | MHD_socket_close_ (sv[1]); | 818 | MHD_socket_close_chk_ (sv[1]); |
819 | free (urh); | 819 | free (urh); |
820 | return MHD_NO; | 820 | return MHD_NO; |
821 | } | 821 | } |
@@ -840,8 +840,8 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
840 | _("Call to epoll_ctl failed: %s\n"), | 840 | _("Call to epoll_ctl failed: %s\n"), |
841 | MHD_socket_last_strerr_ ()); | 841 | MHD_socket_last_strerr_ ()); |
842 | #endif | 842 | #endif |
843 | MHD_socket_close_ (sv[0]); | 843 | MHD_socket_close_chk_ (sv[0]); |
844 | MHD_socket_close_ (sv[1]); | 844 | MHD_socket_close_chk_ (sv[1]); |
845 | free (urh); | 845 | free (urh); |
846 | return MHD_NO; | 846 | return MHD_NO; |
847 | } | 847 | } |
@@ -986,14 +986,14 @@ MHD_destroy_response (struct MHD_Response *response) | |||
986 | 986 | ||
987 | if (NULL == response) | 987 | if (NULL == response) |
988 | return; | 988 | return; |
989 | MHD_mutex_lock_ (&response->mutex); | 989 | MHD_mutex_lock_chk_ (&response->mutex); |
990 | if (0 != --(response->reference_count)) | 990 | if (0 != --(response->reference_count)) |
991 | { | 991 | { |
992 | MHD_mutex_unlock_ (&response->mutex); | 992 | MHD_mutex_unlock_chk_ (&response->mutex); |
993 | return; | 993 | return; |
994 | } | 994 | } |
995 | MHD_mutex_unlock_ (&response->mutex); | 995 | MHD_mutex_unlock_chk_ (&response->mutex); |
996 | MHD_mutex_destroy_ (&response->mutex); | 996 | MHD_mutex_destroy_chk_ (&response->mutex); |
997 | if (NULL != response->crfc) | 997 | if (NULL != response->crfc) |
998 | response->crfc (response->crc_cls); | 998 | response->crfc (response->crc_cls); |
999 | while (NULL != response->first_header) | 999 | while (NULL != response->first_header) |
@@ -1016,9 +1016,9 @@ MHD_destroy_response (struct MHD_Response *response) | |||
1016 | void | 1016 | void |
1017 | MHD_increment_response_rc (struct MHD_Response *response) | 1017 | MHD_increment_response_rc (struct MHD_Response *response) |
1018 | { | 1018 | { |
1019 | MHD_mutex_lock_ (&response->mutex); | 1019 | MHD_mutex_lock_chk_ (&response->mutex); |
1020 | (response->reference_count)++; | 1020 | (response->reference_count)++; |
1021 | MHD_mutex_unlock_ (&response->mutex); | 1021 | MHD_mutex_unlock_chk_ (&response->mutex); |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | 1024 | ||