Fixed overwrite of session context
This commit is contained in:
parent
c6f4a83051
commit
7155f604c1
1 changed files with 6 additions and 4 deletions
|
@ -897,11 +897,13 @@ int libp2p_secio_handshake(struct SessionContext* local_session, struct RsaPriva
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
libp2p_logger_debug("secio", "Same remote connected. Replacing SessionContext.\n");
|
if (remote_peer->sessionContext != local_session) {
|
||||||
// clean up old session context
|
// clean up old session context
|
||||||
|
libp2p_logger_debug("secio", "Same remote connected. Replacing SessionContext.\n");
|
||||||
libp2p_session_context_free(remote_peer->sessionContext);
|
libp2p_session_context_free(remote_peer->sessionContext);
|
||||||
}
|
|
||||||
remote_peer->sessionContext = local_session;
|
remote_peer->sessionContext = local_session;
|
||||||
|
}
|
||||||
|
}
|
||||||
remote_peer->connection_type = CONNECTION_TYPE_CONNECTED;
|
remote_peer->connection_type = CONNECTION_TYPE_CONNECTED;
|
||||||
|
|
||||||
if (new_peer) {
|
if (new_peer) {
|
||||||
|
|
Loading…
Reference in a new issue