aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2026-06-29 15:53:53 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2026-06-29 15:53:53 +0000
commitd40b35f8eb1dbab430d595193ddb1c950766bcac (patch)
treef26c0e149b36e31b7aa377454ba79059e1a0a0f2
parentf52803e475d50f6d1996aa97c14be043e288185c (diff)
Revert "libfetch: Make fetch_ref an inline"
This reverts commit 672cb7320a2754788bddf5cd026721b6f70a0d30.
-rw-r--r--lib/libfetch/common.c11
-rw-r--r--lib/libfetch/common.h13
-rw-r--r--lib/libfetch/ftp.c2
3 files changed, 13 insertions, 13 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index 74748e5b7d17..d1a897b98827 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -301,6 +301,17 @@ fetch_reopen(int sd)
/*
+ * Bump a connection's reference count.
+ */
+conn_t *
+fetch_ref(conn_t *conn)
+{
+ ++conn->ref;
+ return (conn);
+}
+
+
+/*
* Resolve an address
*/
struct addrinfo *
diff --git a/lib/libfetch/common.h b/lib/libfetch/common.h
index 143d4fe82945..5ad9bde513a0 100644
--- a/lib/libfetch/common.h
+++ b/lib/libfetch/common.h
@@ -61,18 +61,6 @@ struct fetchconn {
int ref; /* reference count */
};
-static inline conn_t *fetch_ref(conn_t *conn)
-{
- ++conn->ref;
- return (conn);
-}
-
-static inline conn_t *fetch_deref(conn_t *conn)
-{
- --conn->ref;
- return (conn);
-}
-
/* Structure used for error message lists */
struct fetcherr {
const int num;
@@ -127,6 +115,7 @@ struct addrinfo *fetch_resolve(const char *, int, int);
int fetch_bind(int, int, const char *);
conn_t *fetch_connect(const char *, int, int, int);
conn_t *fetch_reopen(int);
+conn_t *fetch_ref(conn_t *);
#ifdef WITH_SSL
int fetch_ssl_cb_verify_crt(int, X509_STORE_CTX*);
#endif
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 5e4148e0fa2c..fc096054c9a2 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -1133,7 +1133,7 @@ ftp_request(struct url *url, const char *op, struct url_stat *us,
/* just a stat */
if (strcmp(op, "STAT") == 0) {
- fetch_deref(conn);
+ --conn->ref;
ftp_disconnect(conn);
return (FILE *)1; /* bogus return value */
}