]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
remove some more unused code
authorRoger Dingledine <arma@torproject.org>
Thu, 14 Apr 2016 06:18:25 +0000 (02:18 -0400)
committerRoger Dingledine <arma@torproject.org>
Mon, 9 May 2016 18:42:09 +0000 (14:42 -0400)
src/or/connection.c
src/or/connection.h

index 118e239176a7f17129f7a371301f19cfed7b62e9..4fbbaf1abdc6b028b7f6c09fad678f7ac82bdd79 100644 (file)
@@ -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,
index 45175cd5a2a9f10397866602a1a3ce3e127142aa..4835235fba7e8a341a5a0ba963df503ea9c098c1 100644 (file)
@@ -192,13 +192,6 @@ MOCK_DECL(connection_t *,connection_get_by_type_addr_port_purpose,(int type,
 connection_t *connection_get_by_type_state(int type, int state);
 connection_t *connection_get_by_type_state_rendquery(int type, int state,
                                                      const char *rendquery);
-dir_connection_t *connection_dir_get_by_purpose_and_resource(
-                                                  int purpose,
-                                                  const char *resource);
-dir_connection_t *connection_dir_get_by_purpose_resource_and_state(
-                                                  int purpose,
-                                                  const char *resource,
-                                                  int state);
 smartlist_t *connection_dir_list_by_purpose_and_resource(
                                                   int purpose,
                                                   const char *resource);