On Tue, Aug 02, 2022 at 03:59:40PM +0200, Claudio Jeker wrote:
> What makes you think that 15sec is enough to open connections in all
> scenarios? I feel this is one of those changes that just shows that
> maybe the current connect timeout from the system is too conservative.
Yeah, maybe. How about this instead?
Seems to work well for me.
Kind regards,
Job
Index: extern.h
===================================================================
RCS file: /cvs/src/usr.sbin/rpki-client/extern.h,v
retrieving revision 1.143
diff -u -p -r1.143 extern.h
--- extern.h 27 Jun 2022 10:18:27 -0000 1.143
+++ extern.h 2 Aug 2022 18:10:00 -0000
@@ -727,6 +727,9 @@ int mkpathat(int, const char *);
#define MAX_HTTP_REQUESTS 64
#define MAX_RSYNC_REQUESTS 16
+/* How many seconds to wait for a connection to succeed. */
+#define MAX_CONTIMEOUT 15
+
/* Maximum allowd repositories per tal */
#define MAX_REPO_PER_TAL 1000
Index: http.c
===================================================================
RCS file: /cvs/src/usr.sbin/rpki-client/http.c,v
retrieving revision 1.62
diff -u -p -r1.62 http.c
--- http.c 24 May 2022 09:22:45 -0000 1.62
+++ http.c 2 Aug 2022 18:10:01 -0000
@@ -70,7 +70,7 @@
#define HTTP_USER_AGENT "OpenBSD rpki-client"
#define HTTP_BUF_SIZE (32 * 1024)
#define HTTP_IDLE_TIMEOUT 10
-#define HTTP_IO_TIMEOUT (3 * 60)
+#define HTTP_IO_TIMEOUT 15
#define MAX_CONTENTLEN (2 * 1024 * 1024 * 1024LL)
#define NPFDS (MAX_HTTP_REQUESTS + 1)
Index: rsync.c
===================================================================
RCS file: /cvs/src/usr.sbin/rpki-client/rsync.c,v
retrieving revision 1.38
diff -u -p -r1.38 rsync.c
--- rsync.c 24 May 2022 09:20:49 -0000 1.38
+++ rsync.c 2 Aug 2022 18:10:01 -0000
@@ -312,6 +312,7 @@ proc_rsync(char *prog, char *bind_addr,
args[i++] = "-rt";
args[i++] = "--no-motd";
args[i++] = "--max-size=" STRINGIFY(MAX_FILE_SIZE);
+ args[i++] = "--contimeout=" STRINGIFY(MAX_CONTIMEOUT);
args[i++] = "--timeout=180";
args[i++] = "--include=*/";
args[i++] = "--include=*.cer";