Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
JFreegman committed Jun 1, 2020
1 parent 5078abe commit 06017d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion toxcore/group_chats.c
Expand Up @@ -4187,6 +4187,7 @@ static int send_gc_oob_handshake_packet(const GC_Chat *chat, uint32_t peer_numbe
static int handle_gc_handshake_response(const Messenger *m, int group_number, const uint8_t *sender_pk,
const uint8_t *data, uint16_t length)
{
fprintf(stderr, "got handshake response\n");
if (length < ENC_PUBLIC_KEY + SIG_PUBLIC_KEY + 1) {
return -1;
}
Expand Down Expand Up @@ -4225,9 +4226,11 @@ static int handle_gc_handshake_response(const Messenger *m, int group_number, co
switch (request_type) {
case HS_INVITE_REQUEST:
ret = send_gc_invite_request(chat, gconn);
fprintf(stderr, "sending inite req\n");
break;

case HS_PEER_INFO_EXCHANGE:
fprintf(stderr, "sending peer ex\n");
ret = send_gc_peer_exchange(m->group_handler, chat, gconn);
break;

Expand Down Expand Up @@ -4262,6 +4265,7 @@ static int send_gc_handshake_response(const GC_Chat *chat, uint32_t peer_number,
static int handle_gc_handshake_request(Messenger *m, int group_number, const IP_Port *ipp, const uint8_t *sender_pk,
const uint8_t *data, uint32_t length)
{
fprintf(stderr, "got handshake request\n");
if (length < ENC_PUBLIC_KEY + SIG_PUBLIC_KEY + sizeof(uint8_t) + sizeof(uint8_t)) {
return -1;
}
Expand Down Expand Up @@ -4309,7 +4313,8 @@ static int handle_gc_handshake_request(Messenger *m, int group_number, const IP_
}

if (gconn->handshaked) {
return -1;
fprintf(stderr, "already handshaked\n");
gconn->handshaked = false;
}
}

Expand Down Expand Up @@ -4364,6 +4369,7 @@ static int handle_gc_handshake_request(Messenger *m, int group_number, const IP_
gconn->received_message_id = 1; // handshake request is always first packet
gconn->is_pending_handshake_response = true;
gconn->pending_handshake_type = request_type;
fprintf(stderr, "handshake request handled successfully\n");

return peer_number;
}
Expand Down

0 comments on commit 06017d2

Please sign in to comment.