diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2020-11-30 00:35:18 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2020-11-30 00:35:18 +0300 |
commit | 958d8704e85fd94f76aea7a666557de9794df480 (patch) | |
tree | 13a41bc34bff22f1f8ce0b896bac09820c9051f8 /src/microhttpd/response.c | |
parent | 8435c616da188dbb0608774503506fc70c579d5d (diff) | |
download | libmicrohttpd-958d8704e85fd94f76aea7a666557de9794df480.tar.gz libmicrohttpd-958d8704e85fd94f76aea7a666557de9794df480.zip |
Removed gnutls_record_(un)cork() usage.
gnutls_record_cork()/gnutls_record_uncork() needs
special handling to periodically push part of the buffer.
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r-- | src/microhttpd/response.c | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index dc04cab5..489be718 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -894,53 +894,25 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, | |||
894 | case MHD_UPGRADE_ACTION_CORK_ON: | 894 | case MHD_UPGRADE_ACTION_CORK_ON: |
895 | if (connection->sk_cork_on) | 895 | if (connection->sk_cork_on) |
896 | return MHD_YES; | 896 | return MHD_YES; |
897 | #ifdef HTTPS_SUPPORT | 897 | if (0 != |
898 | if (0 != (daemon->options & MHD_USE_TLS) ) | 898 | MHD_socket_cork_ (connection->socket_fd, |
899 | true)) | ||
899 | { | 900 | { |
900 | gnutls_record_cork (connection->tls_session); | ||
901 | connection->sk_cork_on = true; | 901 | connection->sk_cork_on = true; |
902 | return MHD_YES; | 902 | return MHD_YES; |
903 | } | 903 | } |
904 | else | 904 | return MHD_NO; |
905 | #endif | ||
906 | { | ||
907 | if (0 != | ||
908 | MHD_socket_cork_ (connection->socket_fd, | ||
909 | true)) | ||
910 | { | ||
911 | connection->sk_cork_on = true; | ||
912 | return MHD_YES; | ||
913 | } | ||
914 | return MHD_NO; | ||
915 | } | ||
916 | case MHD_UPGRADE_ACTION_CORK_OFF: | 905 | case MHD_UPGRADE_ACTION_CORK_OFF: |
917 | if (! connection->sk_cork_on) | 906 | if (! connection->sk_cork_on) |
918 | return MHD_YES; | 907 | return MHD_YES; |
919 | #ifdef HTTPS_SUPPORT | 908 | if (0 != |
920 | if (0 != (daemon->options & MHD_USE_TLS) ) | 909 | MHD_socket_cork_ (connection->socket_fd, |
910 | false)) | ||
921 | { | 911 | { |
922 | int err; | ||
923 | |||
924 | err = gnutls_record_uncork (connection->tls_session, 0); | ||
925 | if (0 > err) | ||
926 | return MHD_NO; | ||
927 | connection->sk_cork_on = false; | 912 | connection->sk_cork_on = false; |
928 | return MHD_YES; | 913 | return MHD_YES; |
929 | } | 914 | } |
930 | else | 915 | return MHD_NO; |
931 | #endif | ||
932 | { | ||
933 | if (! connection->sk_cork_on) | ||
934 | return MHD_YES; | ||
935 | if (0 != | ||
936 | MHD_socket_cork_ (connection->socket_fd, | ||
937 | false)) | ||
938 | { | ||
939 | connection->sk_cork_on = false; | ||
940 | return MHD_YES; | ||
941 | } | ||
942 | return MHD_NO; | ||
943 | } | ||
944 | default: | 916 | default: |
945 | /* we don't understand this one */ | 917 | /* we don't understand this one */ |
946 | return MHD_NO; | 918 | return MHD_NO; |