aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/response.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-08-01 21:40:47 +0200
committerChristian Grothoff <christian@grothoff.org>2019-08-01 21:40:47 +0200
commit26368ac8f1a32f49eaffae77abcfc595c62802bd (patch)
tree0e444c75bb66730ea96929fda487fbee4e26c41f /src/microhttpd/response.c
parent97fd0a6557b98166f9617370e1497d47e80e9a04 (diff)
downloadlibmicrohttpd-26368ac8f1a32f49eaffae77abcfc595c62802bd.tar.gz
libmicrohttpd-26368ac8f1a32f49eaffae77abcfc595c62802bd.zip
add ways for application to control corking for upgraded sockets
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r--src/microhttpd/response.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 7b98a45c..65ea7b09 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -825,6 +825,44 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
825 * be moved to cleanup list by MHD_resume_connection(). */ 825 * be moved to cleanup list by MHD_resume_connection(). */
826 MHD_resume_connection (connection); 826 MHD_resume_connection (connection);
827 return MHD_YES; 827 return MHD_YES;
828 case MHD_UPGRADE_ACTION_CORK_ON:
829 if (connection->sk_cork_on)
830 return MHD_YES;
831#ifdef HTTPS_SUPPORT
832 if (0 != (daemon->options & MHD_USE_TLS) )
833 {
834 gnutls_record_cork (connection->tls_session);
835 connection->sk_cork_on = true;
836 return MHD_YES;
837 }
838 else
839#else
840 {
841 if (0 ==
842 MHD_socket_cork_ (connection->socket_fd,
843 true))
844 connection->sk_cork_on = true;
845 }
846#endif
847 case MHD_UPGRADE_ACTION_CORK_OFF:
848 if (! connection->sk_cork_on)
849 return MHD_YES;
850#ifdef HTTPS_SUPPORT
851 if (0 != (daemon->options & MHD_USE_TLS) )
852 {
853 gnutls_record_uncork (connection->tls_session, 0);
854 connection->sk_cork_on = false;
855 return MHD_YES;
856 }
857 else
858#else
859 {
860 if (0 ==
861 MHD_socket_cork_ (connection->socket_fd,
862 false))
863 connection->sk_cork_on = false;
864 }
865#endif
828 default: 866 default:
829 /* we don't understand this one */ 867 /* we don't understand this one */
830 return MHD_NO; 868 return MHD_NO;