Skip to content

Commit

Permalink
Fix handshake bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JFreegman committed Jun 2, 2020
1 parent 5078abe commit b8776fa
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions toxcore/group_chats.c
Expand Up @@ -4309,6 +4309,7 @@ static int handle_gc_handshake_request(Messenger *m, int group_number, const IP_
}

if (gconn->handshaked) {
gconn->handshaked = false;
return -1;
}
}
Expand Down Expand Up @@ -4388,13 +4389,6 @@ static int handle_gc_handshake_packet(Messenger *m, const GC_Chat *chat, const I

// probably got multiple announcements from the same peer with a differet session key
if (plain_len != SIZEOF_VLA(data)) {
int peer_number = get_peernum_of_enc_pk(chat, sender_pk, false);
GC_Connection *gconn = gcc_get_connection(chat, peer_number);

if (gconn != nullptr) {
gcc_mark_for_deletion(gconn, chat->tcp_conn, GC_EXIT_TYPE_DISCONNECTED, nullptr, 0);
}

LOGGER_DEBUG(m->log, "Failed to unwrap handshake packet");
return -1;
}
Expand Down

0 comments on commit b8776fa

Please sign in to comment.