[core] adjust when TCP_CORK used on TLS connection

personal/stbuehler/tests-path
Glenn Strauss 2022-03-25 02:18:30 -04:00
parent b0e43f3bf7
commit 999457a0e4
1 changed files with 3 additions and 1 deletions

View File

@ -287,7 +287,9 @@ connection_write_chunkqueue (connection * const con, chunkqueue * const restrict
/* Linux: put a cork into socket as we want to combine write() calls
* but only if we really have multiple chunks including non-MEM_CHUNK
* (or if multiple chunks and TLS), and only if TCP socket */
if (NULL != c || (max_bytes > 16384 && con->is_ssl_sock)) {
/* (max_bytes may have been reduced by connection_write_throttle(),
* but not bothering to check; might result in some extra corking) */
if (NULL != c || (con->is_ssl_sock && chunkqueue_length(cq) > 16384)) {
const int sa_family = sock_addr_get_family(&con->srv_socket->addr);
if (sa_family == AF_INET || sa_family == AF_INET6) {
corked = 1;