mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Fix TLS issues with large replies (#10909)
This problem was introduced by 496375f
and seems to more easily reproduce on macOS since OpenSSL writes more frequently return with EAGAIN.
This commit is contained in:
parent
69d5576832
commit
0b645d6319
@ -834,12 +834,12 @@ static int connTLSWritev(connection *conn_, const struct iovec *iov, int iovcnt)
|
||||
* which is not worth doing so much memory copying to reduce system calls,
|
||||
* therefore, invoke connTLSWrite() multiple times to avoid memory copies. */
|
||||
if (iov_bytes_len > NET_MAX_WRITES_PER_EVENT) {
|
||||
size_t tot_sent = 0;
|
||||
ssize_t tot_sent = 0;
|
||||
for (int i = 0; i < iovcnt; i++) {
|
||||
size_t sent = connTLSWrite(conn_, iov[i].iov_base, iov[i].iov_len);
|
||||
ssize_t sent = connTLSWrite(conn_, iov[i].iov_base, iov[i].iov_len);
|
||||
if (sent <= 0) return tot_sent > 0 ? tot_sent : sent;
|
||||
tot_sent += sent;
|
||||
if (sent != iov[i].iov_len) break;
|
||||
if ((size_t) sent != iov[i].iov_len) break;
|
||||
}
|
||||
return tot_sent;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user