|
@@ -561,41 +561,6 @@ connection_free(connection_t *conn)
|
|
|
_connection_free(conn);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- * storage held by connection.c. This is used by cpuworkers and dnsworkers
|
|
|
- * when they fork, so they don't keep resources held open (especially
|
|
|
- * sockets).
|
|
|
- *
|
|
|
- * Don't do the checks in connection_free(), because they will
|
|
|
- * fail.
|
|
|
- */
|
|
|
-void
|
|
|
-connection_free_all(void)
|
|
|
-{
|
|
|
- smartlist_t *conns = get_connection_array();
|
|
|
-
|
|
|
-
|
|
|
- SMARTLIST_FOREACH(conns, connection_t *, conn,
|
|
|
- if (conn->type == CONN_TYPE_CONTROL)
|
|
|
- TO_CONTROL_CONN(conn)->event_mask = 0);
|
|
|
-
|
|
|
- control_update_global_event_mask();
|
|
|
-
|
|
|
-
|
|
|
- connection_or_clear_identity_map();
|
|
|
-
|
|
|
-
|
|
|
- clear_broken_connection_map(0);
|
|
|
-
|
|
|
- SMARTLIST_FOREACH(conns, connection_t *, conn, _connection_free(conn));
|
|
|
-
|
|
|
- if (outgoing_addrs) {
|
|
|
- SMARTLIST_FOREACH(outgoing_addrs, void*, addr, tor_free(addr));
|
|
|
- smartlist_free(outgoing_addrs);
|
|
|
- outgoing_addrs = NULL;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
* Called when we're about to finally unlink and free a connection:
|
|
|
* perform necessary accounting and cleanup
|
|
@@ -4163,3 +4128,42 @@ proxy_type_to_string(int proxy_type)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * storage held by connection.c. This is used by cpuworkers and dnsworkers
|
|
|
+ * when they fork, so they don't keep resources held open (especially
|
|
|
+ * sockets).
|
|
|
+ *
|
|
|
+ * Don't do the checks in connection_free(), because they will
|
|
|
+ * fail.
|
|
|
+ */
|
|
|
+void
|
|
|
+connection_free_all(void)
|
|
|
+{
|
|
|
+ smartlist_t *conns = get_connection_array();
|
|
|
+
|
|
|
+
|
|
|
+ SMARTLIST_FOREACH(conns, connection_t *, conn,
|
|
|
+ if (conn->type == CONN_TYPE_CONTROL)
|
|
|
+ TO_CONTROL_CONN(conn)->event_mask = 0);
|
|
|
+
|
|
|
+ control_update_global_event_mask();
|
|
|
+
|
|
|
+
|
|
|
+ connection_or_clear_identity_map();
|
|
|
+
|
|
|
+
|
|
|
+ clear_broken_connection_map(0);
|
|
|
+
|
|
|
+ SMARTLIST_FOREACH(conns, connection_t *, conn, _connection_free(conn));
|
|
|
+
|
|
|
+ if (outgoing_addrs) {
|
|
|
+ SMARTLIST_FOREACH(outgoing_addrs, void*, addr, tor_free(addr));
|
|
|
+ smartlist_free(outgoing_addrs);
|
|
|
+ outgoing_addrs = NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+#ifdef USE_BUFFEREVENTS
|
|
|
+ if (global_rate_limit)
|
|
|
+ bufferevent_rate_limit_group_free(global_rate_limit);
|
|
|
+#endif
|
|
|
+}
|