From fcf9359d668281ca4bc6475a16442913b4fa7cf2 Mon Sep 17 00:00:00 2001 From: job Date: Mon, 8 Aug 2022 14:10:10 +0000 Subject: [PATCH] Set rsync connection timeout to 15 seconds. OK sthen@ --- usr.sbin/rpki-client/extern.h | 5 ++++- usr.sbin/rpki-client/rsync.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rpki-client/extern.h b/usr.sbin/rpki-client/extern.h index fc79967a615..611632db15a 100644 --- a/usr.sbin/rpki-client/extern.h +++ b/usr.sbin/rpki-client/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.143 2022/06/27 10:18:27 job Exp $ */ +/* $OpenBSD: extern.h,v 1.144 2022/08/08 14:10:10 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -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 diff --git a/usr.sbin/rpki-client/rsync.c b/usr.sbin/rpki-client/rsync.c index 537822f4d78..996d48129c9 100644 --- a/usr.sbin/rpki-client/rsync.c +++ b/usr.sbin/rpki-client/rsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsync.c,v 1.38 2022/05/24 09:20:49 claudio Exp $ */ +/* $OpenBSD: rsync.c,v 1.39 2022/08/08 14:10:10 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -312,6 +312,7 @@ proc_rsync(char *prog, char *bind_addr, int fd) 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"; -- 2.20.1