Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161007927
D57944.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57944.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D57944: libfetch: Make fetch_ref an inline
Attached
Detach File
Event Timeline
Log In to Comment