|
@@ -243,6 +243,8 @@ note_that_we_maybe_cant_complete_circuits(void)
|
|
can_complete_circuits = 0;
|
|
can_complete_circuits = 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static unsigned long eventloop_counter = 0;
|
|
|
|
+
|
|
/** Add <b>conn</b> to the array of connections that we can poll on. The
|
|
/** Add <b>conn</b> to the array of connections that we can poll on. The
|
|
* connection's socket must be set; the connection starts out
|
|
* connection's socket must be set; the connection starts out
|
|
* non-reading and non-writing.
|
|
* non-reading and non-writing.
|
|
@@ -282,8 +284,11 @@ connection_add_impl(connection_t *conn, int is_connecting)
|
|
} else {
|
|
} else {
|
|
tor_assert(conn->type == CONN_TYPE_OR);
|
|
tor_assert(conn->type == CONN_TYPE_OR);
|
|
|
|
|
|
- error_t rv = safe_connection_register_events(conn->safe_conn,
|
|
|
|
- tor_libevent_get_base());
|
|
|
|
|
|
+ int eventloop_index = 1 + (eventloop_counter%(get_num_eventloops()-1));
|
|
|
|
+ struct event_base *base = get_eventloop(eventloop_index);
|
|
|
|
+ eventloop_counter += 1;
|
|
|
|
+ //struct event_base *base = tor_libevent_get_base();
|
|
|
|
+ error_t rv = safe_connection_register_events(conn->safe_conn, base);
|
|
|
|
|
|
if (rv != E_SUCCESS) {
|
|
if (rv != E_SUCCESS) {
|
|
smartlist_remove(connection_array, conn);
|
|
smartlist_remove(connection_array, conn);
|