Page MenuHomeFreeBSD

D57944.diff
No OneTemporary

D57944.diff

diff --git a/lib/libfetch/common.h b/lib/libfetch/common.h
--- a/lib/libfetch/common.h
+++ b/lib/libfetch/common.h
@@ -61,6 +61,18 @@
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;
@@ -115,7 +127,6 @@
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/common.c b/lib/libfetch/common.c
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -300,17 +300,6 @@
}
-/*
- * Bump a connection's reference count.
- */
-conn_t *
-fetch_ref(conn_t *conn)
-{
- ++conn->ref;
- return (conn);
-}
-
-
/*
* Resolve an address
*/
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -1133,7 +1133,7 @@
/* just a stat */
if (strcmp(op, "STAT") == 0) {
- --conn->ref;
+ fetch_deref(conn);
ftp_disconnect(conn);
return (FILE *)1; /* bogus return value */
}

File Metadata

Mime Type
text/plain
Expires
Tue, Jun 30, 7:38 PM (4 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34519946
Default Alt Text
D57944.diff (1 KB)

Event Timeline