[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/02: response: simplified code
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/02: response: simplified code |
Date: |
Sat, 17 Apr 2021 17:53:07 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 2a0c96ff5bba1bf153e067e5021f974dbca71525
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Apr 17 18:50:52 2021 +0300
response: simplified code
Reused cork set functions from mhd_send.
---
src/microhttpd/response.c | 27 +++++++--------------------
1 file 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 @@
#include "mhd_str.h"
#include "connection.h"
#include "memorypool.h"
+#include "mhd_send.h"
#include "mhd_compat.h"
@@ -1042,27 +1043,13 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle
*urh,
MHD_resume_connection (connection);
return MHD_YES;
case MHD_UPGRADE_ACTION_CORK_ON:
- if (_MHD_ON == connection->sk_corked)
- return MHD_YES;
- if (0 !=
- MHD_socket_cork_ (connection->socket_fd,
- true))
- {
- connection->sk_corked = _MHD_ON;
- return MHD_YES;
- }
- return MHD_NO;
+ /* Unportable API. TODO: replace with portable action. */
+ return MHD_connection_set_cork_state_ (connection,
+ true) ? MHD_YES : MHD_NO;
case MHD_UPGRADE_ACTION_CORK_OFF:
- if (_MHD_OFF == connection->sk_corked)
- return MHD_YES;
- if (0 !=
- MHD_socket_cork_ (connection->socket_fd,
- false))
- {
- connection->sk_corked = _MHD_OFF;
- return MHD_YES;
- }
- return MHD_NO;
+ /* Unportable API. TODO: replace with portable action. */
+ return MHD_connection_set_cork_state_ (connection,
+ false) ? MHD_YES : MHD_NO;
default:
/* we don't understand this one */
return MHD_NO;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.