diff options
| author | Eugene Grosbein <eugen@FreeBSD.org> | 2026-01-22 08:40:35 +0000 |
|---|---|---|
| committer | Eugene Grosbein <eugen@FreeBSD.org> | 2026-01-22 08:40:35 +0000 |
| commit | 8f8a7f6fffd7dca09013f7c4bfa075bc3825fb8e (patch) | |
| tree | 591a208bae7fd371fa4616842978d7ddd14ba0af /lib/libfetch | |
| parent | ad9932995cf8f93143ff033712016d95b5cb7a50 (diff) | |
Diffstat (limited to 'lib/libfetch')
| -rw-r--r-- | lib/libfetch/common.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 2e1364edff04..a9935ef176da 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -1265,6 +1265,14 @@ fetch_ssl_read(SSL *ssl, char *buf, size_t len) { ssize_t rlen; int ssl_err; + struct timeval tv; + + if (fetchTimeout > 0) { + tv.tv_sec = fetchTimeout; + tv.tv_usec = 0; + setsockopt(SSL_get_fd(ssl), SOL_SOCKET, SO_RCVTIMEO, + &tv, sizeof(tv)); + } rlen = SSL_read(ssl, buf, len); if (rlen < 0) { |
