From cb5cc1c3667820727c6b11bdc057097c582f95f0 Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 10 May 2021 15:12:33 +0000 Subject: [PATCH] To add keep-alive support the read handler got changed a lot. Now when tls_read hits the EOF (s == 0) case it is always a cause to close the connection. All possible data was already consumed and if something is still in the buffer then it remained in there for a reason. Issue noticed and OK deraadt@ --- usr.sbin/rpki-client/http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rpki-client/http.c b/usr.sbin/rpki-client/http.c index 1ce8cd52536..224d456ee35 100644 --- a/usr.sbin/rpki-client/http.c +++ b/usr.sbin/rpki-client/http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: http.c,v 1.32 2021/04/20 14:32:49 claudio Exp $ */ +/* $OpenBSD: http.c,v 1.33 2021/05/10 15:12:33 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2020 Claudio Jeker @@ -1123,7 +1123,7 @@ read_more: return WANT_POLLOUT; } - if (s == 0 && conn->bufpos == 0) { + if (s == 0) { if (conn->req) warnx("%s: short read, connection closed", http_info(conn->req->uri)); -- 2.20.1