summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-05-19 08:17:02 -0400
committerNick Mathewson <nickm@torproject.org>2016-05-19 08:17:02 -0400
commit9f217c83b0d91508af0d63f04216fa78cdbfbe1b (patch)
treeec66be6c1139d45ebc2ad81d09156445ceca4b3c /src/or/connection.c
parent3f49474349538be499ab485c697c147c8829fa0d (diff)
parentf698b509d8efdc055cfc05c6feaf0aecee41b9d0 (diff)
downloadtor-9f217c83b0d91508af0d63f04216fa78cdbfbe1b.tar.gz
tor-9f217c83b0d91508af0d63f04216fa78cdbfbe1b.zip
Merge branch 'bug18809_028_squashed' into maint-0.2.8
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 118e239176..4fbbaf1abd 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -4438,32 +4438,6 @@ connection_get_by_type_state_rendquery(int type, int state,
));
}
-#define CONN_FIRST_AND_FREE_TEMPLATE(sl) \
- STMT_BEGIN \
- if (smartlist_len(sl) > 0) { \
- void *first_item = smartlist_get(sl, 0); \
- smartlist_free(sl); \
- return first_item; \
- } else { \
- smartlist_free(sl); \
- return NULL; \
- } \
- STMT_END
-
-/** Return a directory connection (if any one exists) that is fetching
- * the item described by <b>purpose</b>/<b>resource</b>, otherwise return NULL.
- */
-dir_connection_t *
-connection_dir_get_by_purpose_and_resource(
- int purpose,
- const char *resource)
-{
- smartlist_t *conns = connection_dir_list_by_purpose_and_resource(
- purpose,
- resource);
- CONN_FIRST_AND_FREE_TEMPLATE(conns);
-}
-
/** Return a new smartlist of dir_connection_t * from get_connection_array()
* that satisfy conn_test on connection_t *conn_var, and dirconn_test on
* dir_connection_t *dirconn_var. conn_var must be of CONN_TYPE_DIR and not
@@ -4504,25 +4478,6 @@ connection_dir_list_by_purpose_and_resource(
dirconn->requested_resource));
}
-/** Return a directory connection (if any one exists) that is fetching
- * the item described by <b>purpose</b>/<b>resource</b>/<b>state</b>,
- * otherwise return NULL. */
-dir_connection_t *
-connection_dir_get_by_purpose_resource_and_state(
- int purpose,
- const char *resource,
- int state)
-{
- smartlist_t *conns =
- connection_dir_list_by_purpose_resource_and_state(
- purpose,
- resource,
- state);
- CONN_FIRST_AND_FREE_TEMPLATE(conns);
-}
-
-#undef CONN_FIRST_AND_FREE_TEMPLATE
-
/** Return a list of directory connections that are fetching the item
* described by <b>purpose</b>/<b>resource</b>/<b>state</b>. If there are
* none, return an empty list. This list must be freed using smartlist_free,