From 334f0ce95892bcb33cdcbd0f4c27bcef2b987bb0 Mon Sep 17 00:00:00 2001 From: claudio Date: Wed, 3 May 2023 07:51:08 +0000 Subject: [PATCH] On read failure just abort the rrdp request. Before a read error would not be removed from the poll fds and trigger constantly. RRDP_STATE_PARSE_ERROR should only be used for errors from xml parser since then the remaining data from the socket still needs to be consumed. OK tb@ --- usr.sbin/rpki-client/rrdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rpki-client/rrdp.c b/usr.sbin/rpki-client/rrdp.c index e5fe791867c..d254beca5d4 100644 --- a/usr.sbin/rpki-client/rrdp.c +++ b/usr.sbin/rpki-client/rrdp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrdp.c,v 1.29 2023/01/04 16:51:34 job Exp $ */ +/* $OpenBSD: rrdp.c,v 1.30 2023/05/03 07:51:08 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2021 Claudio Jeker @@ -503,8 +503,8 @@ rrdp_data_handler(struct rrdp *s) len = read(s->infd, buf, sizeof(buf)); if (len == -1) { - s->state |= RRDP_STATE_PARSE_ERROR; warn("%s: read failure", s->local); + rrdp_abort_req(s); return; } if ((s->state & RRDP_STATE_PARSE) == 0) -- 2.20.1