Index | Thread | Search

From:
Job Snijders <job@bsd.nl>
Subject:
rpki-client: on persistent HTTP connections clear last_modified for next request
To:
tech@openbsd.org
Date:
Sat, 13 Jun 2026 04:52:20 +0000

Download raw body.

Thread
  • Job Snijders:

    rpki-client: on persistent HTTP connections clear last_modified for next request

On persistent connections, make sure an earlier "Last-Modified" header
field instance is cleared, in case a later response doesn't contain its
own "Last-Modified" header field.

Based on a question from Ties de Kock from RIPE NCC

OK?

Index: http.c
===================================================================
RCS file: /cvs/src/usr.sbin/rpki-client/http.c,v
diff -u -p -r1.103 http.c
--- http.c	21 May 2026 21:12:04 -0000	1.103
+++ http.c	13 Jun 2026 04:49:47 -0000
@@ -941,11 +941,13 @@ http_done(struct http_connection *conn, 
 	LIST_REMOVE(conn, entry);
 	LIST_INSERT_HEAD(&idle, conn, entry);
 
-	/* reset totalsz, status and keep-alive for good measure */
+	/* reset connection parameters in preparation for a next request */
 	conn->totalsz = 0;
 	conn->was_gzipped = 0;
 	conn->status = 0;
 	conn->keep_alive = 0;
+	free(conn->last_modified);
+	conn->last_modified = NULL;
 
 	return WANT_POLLIN;
 }