Skip to content

Commit 0400daa

Browse files
committed
Fix accounting for (non-)gzipped HTTP traffic
OK tb@
1 parent 29a15cf commit 0400daa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

usr.sbin/rpki-client/http.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: http.c,v 1.96 2025/06/16 15:35:29 claudio Exp $ */
1+
/* $OpenBSD: http.c,v 1.97 2025/06/18 18:13:49 job Exp $ */
22
/*
33
* Copyright (c) 2020 Nils Fisher <[email protected]>
44
* Copyright (c) 2020 Claudio Jeker <[email protected]>
@@ -916,11 +916,10 @@ http_done(struct http_connection *conn, enum http_result res)
916916
conn->was_gzipped = 1;
917917
}
918918

919-
if (conn->was_gzipped)
920-
conn->was_gzipped = 0;
921-
else if (conn->totalsz > (1024 * 1024))
919+
if (!conn->was_gzipped && conn->totalsz > (1024 * 1024))
922920
logx("%s: downloaded %zu bytes without HTTP "
923921
"compression", conn_info(conn), conn->totalsz);
922+
conn->was_gzipped = 0;
924923

925924
conn->state = STATE_IDLE;
926925
conn->idle_time = getmonotime() + HTTP_IDLE_TIMEOUT;

0 commit comments

Comments
 (0)