Reset the io_time (io timeout value) when the timer expires. Without this
authorclaudio <claudio@openbsd.org>
Wed, 10 May 2023 15:24:41 +0000 (15:24 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 10 May 2023 15:24:41 +0000 (15:24 +0000)
the next connect will immediatly timeout again which is not intended.
It does not matter in the other case since the connection is destroyed anyway.
Problem noticed by job@ and Jelle (jelle (at) luteijn.email)
OK job@ tb@

usr.sbin/rpki-client/http.c

index 6c78bc0..700f06b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: http.c,v 1.73 2022/11/02 16:50:51 claudio Exp $ */
+/*     $OpenBSD: http.c,v 1.74 2023/05/10 15:24:41 claudio Exp $ */
 /*
  * Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
  * Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@@ -1954,6 +1954,7 @@ proc_http(char *bind_addr, int fd)
                        if (conn->pfd != NULL && conn->pfd->revents != 0)
                                http_do(conn, http_handle);
                        else if (conn->io_time <= now) {
+                               conn->io_time = 0;
                                if (conn->state == STATE_CONNECT) {
                                        warnx("%s: connect timeout",
                                            conn_info(conn));