diff options
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r-- | src/microhttpd/response.c | 38 |
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; |