GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 46ccde66 authored by Neel Chauhan's avatar Neel Chauhan Committed by David Goulet

Use connection_or_change_state() in v3 handshaking state change

parent 4a0cd795
Pipeline #1666 passed with stage
in 69 minutes and 49 seconds
o Minor bugfixes (circuit, handshake):
- In the v3 handshaking code, Use connection_or_change_state() to change
the state. Previously, we changed the state directly, but this did not
pass a state change to the pubsub or channel object. Fixes bug 32880;
bugfix on 0.2.3.6-alpha. Patch by Neel Chauhan.
......@@ -1428,7 +1428,7 @@ enter_v3_handshake_with_cell(var_cell_t *cell, channel_tls_t *chan)
"OR_HANDSHAKING_V3, on a connection we originated.");
}
connection_or_block_renegotiation(chan->conn);
chan->conn->base_.state = OR_CONN_STATE_OR_HANDSHAKING_V3;
connection_or_change_state(chan->conn, OR_CONN_STATE_OR_HANDSHAKING_V3);
if (connection_init_or_handshake_state(chan->conn, started_here) < 0) {
connection_or_close_for_error(chan->conn, 0);
return -1;
......
......@@ -414,7 +414,7 @@ connection_or_state_publish(const or_connection_t *conn, uint8_t state)
* be notified.
*/
MOCK_IMPL(STATIC void,
MOCK_IMPL(void,
connection_or_change_state,(or_connection_t *conn, uint8_t state))
{
tor_assert(conn);
......
......@@ -120,14 +120,14 @@ void connection_or_group_set_badness_(smartlist_t *group, int force);
#ifdef CONNECTION_OR_PRIVATE
STATIC int should_connect_to_relay(const or_connection_t *or_conn);
STATIC void note_or_connect_failed(const or_connection_t *or_conn);
#endif /* defined(CONNECTION_OR_PRIVATE) */
/*
* Call this when changing connection state, so notifications to the owning
* channel can be handled.
*/
MOCK_DECL(STATIC void,connection_or_change_state,
MOCK_DECL(void, connection_or_change_state,
(or_connection_t *conn, uint8_t state));
#endif /* defined(CONNECTION_OR_PRIVATE) */
#ifdef TOR_UNIT_TESTS
extern int testing__connection_or_pretend_TLSSECRET_is_supported;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment