aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-07-22 18:28:02 +0200
committerChristian Grothoff <christian@grothoff.org>2019-07-22 18:28:02 +0200
commit5304f73f9e8ebeafc1b80f2033b7c3add1169e75 (patch)
treef6d486fa17e3e1a0a1fa2d884473b260a61e301f /src/microhttpd
parenta0588fc0c2e70022753163fcad8bb95726c643c2 (diff)
downloadlibmicrohttpd-5304f73f9e8ebeafc1b80f2033b7c3add1169e75.tar.gz
libmicrohttpd-5304f73f9e8ebeafc1b80f2033b7c3add1169e75.zip
gnutls cork integration
Diffstat (limited to 'src/microhttpd')
-rw-r--r--src/microhttpd/mhd_send.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 34c8e99f..b77d6614 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -170,11 +170,16 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
170#endif 170#endif
171 171
172#ifdef HTTPS_SUPPORT 172#ifdef HTTPS_SUPPORT
173
173 if (using_tls) 174 if (using_tls)
174 { 175 {
175 int i; 176 if (want_cork && ! have_cork)
176 if (i > SSIZE_MAX) 177 {
177 i = SSIZE_MAX; 178 gnutls_record_cork (connection->tls_session);
179 connection->sk_tcp_nodelay_on = false;
180 }
181 if (buffer_size > SSIZE_MAX)
182 buffer_size = SSIZE_MAX;
178 ret = gnutls_record_send (connection->tls_session, 183 ret = gnutls_record_send (connection->tls_session,
179 buffer, 184 buffer,
180 buffer_size); 185 buffer_size);
@@ -198,6 +203,12 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
198 * sent amount smaller than provided amount, as TLS 203 * sent amount smaller than provided amount, as TLS
199 * connections may break data into smaller parts for sending. */ 204 * connections may break data into smaller parts for sending. */
200#endif /* EPOLL_SUPPORT */ 205#endif /* EPOLL_SUPPORT */
206
207 if (! want_cork && have_cork)
208 {
209 (void) gnutls_record_uncork (connection->tls_session, 0);
210 connection->sk_tcp_nodelay_on = true;
211 }
201 } 212 }
202 else 213 else
203#endif 214#endif
@@ -288,13 +299,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
288 } 299 }
289#endif 300#endif
290 301
291 /*
292 // pseudo-code for gnutls corking
293 if (have_more_data && !corked)
294 gnutls_record_cork(connection->tls_session);
295 if (!have_more_data && corked)
296 gnutls_record_uncork(connection->tls_session);
297 */
298 return ret; 302 return ret;
299} 303}
300 304