diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-04-17 18:50:52 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-04-17 18:50:52 +0300 |
commit | 2a0c96ff5bba1bf153e067e5021f974dbca71525 (patch) | |
tree | 7f75d6545f515e30cd6640241c797eca4c230f35 /src/microhttpd | |
parent | c1b8333aa83738179f192ea2814cdaf88c22b711 (diff) | |
download | libmicrohttpd-2a0c96ff5bba1bf153e067e5021f974dbca71525.tar.gz libmicrohttpd-2a0c96ff5bba1bf153e067e5021f974dbca71525.zip |
response: simplified code
Reused cork set functions from mhd_send.
Diffstat (limited to 'src/microhttpd')
-rw-r--r-- | src/microhttpd/response.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index c4b6c1e0..5dcdca18 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "mhd_str.h" | 42 | #include "mhd_str.h" |
43 | #include "connection.h" | 43 | #include "connection.h" |
44 | #include "memorypool.h" | 44 | #include "memorypool.h" |
45 | #include "mhd_send.h" | ||
45 | #include "mhd_compat.h" | 46 | #include "mhd_compat.h" |
46 | 47 | ||
47 | 48 | ||
@@ -1042,27 +1043,13 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, | |||
1042 | MHD_resume_connection (connection); | 1043 | MHD_resume_connection (connection); |
1043 | return MHD_YES; | 1044 | return MHD_YES; |
1044 | case MHD_UPGRADE_ACTION_CORK_ON: | 1045 | case MHD_UPGRADE_ACTION_CORK_ON: |
1045 | if (_MHD_ON == connection->sk_corked) | 1046 | /* Unportable API. TODO: replace with portable action. */ |
1046 | return MHD_YES; | 1047 | return MHD_connection_set_cork_state_ (connection, |
1047 | if (0 != | 1048 | true) ? MHD_YES : MHD_NO; |
1048 | MHD_socket_cork_ (connection->socket_fd, | ||
1049 | true)) | ||
1050 | { | ||
1051 | connection->sk_corked = _MHD_ON; | ||
1052 | return MHD_YES; | ||
1053 | } | ||
1054 | return MHD_NO; | ||
1055 | case MHD_UPGRADE_ACTION_CORK_OFF: | 1049 | case MHD_UPGRADE_ACTION_CORK_OFF: |
1056 | if (_MHD_OFF == connection->sk_corked) | 1050 | /* Unportable API. TODO: replace with portable action. */ |
1057 | return MHD_YES; | 1051 | return MHD_connection_set_cork_state_ (connection, |
1058 | if (0 != | 1052 | false) ? MHD_YES : MHD_NO; |
1059 | MHD_socket_cork_ (connection->socket_fd, | ||
1060 | false)) | ||
1061 | { | ||
1062 | connection->sk_corked = _MHD_OFF; | ||
1063 | return MHD_YES; | ||
1064 | } | ||
1065 | return MHD_NO; | ||
1066 | default: | 1053 | default: |
1067 | /* we don't understand this one */ | 1054 | /* we don't understand this one */ |
1068 | return MHD_NO; | 1055 | return MHD_NO; |