Fixed some possible ways connections could linger indefinitely without being killed.

This commit is contained in:
irungentoo 2014-03-07 16:05:08 -05:00
parent b451565f17
commit d058a59ccf
3 changed files with 9 additions and 0 deletions

View File

@ -1083,6 +1083,9 @@ static void do_new(Lossless_UDP *ludp)
if (tmp->status != LUDP_NO_CONNECTION && tmp->killat < temp_time)
tmp->status = LUDP_TIMED_OUT;
if (tmp->inbound == LUDP_CONNECTION_INBOUND && tmp->status == LUDP_TIMED_OUT)
kill_connection(ludp, tmp_i);
}
}

View File

@ -2140,6 +2140,8 @@ void do_inbound(Messenger *m)
accept_crypto_inbound(m->net_crypto, inconnection, public_key, secret_nonce, session_key);
set_friend_status(m, friend_id, FRIEND_CONFIRMED);
} else {
kill_connection(m->net_crypto->lossless_udp, inconnection);
}
}
}

View File

@ -573,7 +573,11 @@ int crypto_inbound(Net_Crypto *c, uint8_t *public_key, uint8_t *secret_nonce, ui
if (handle_cryptohandshake(c, public_key, secret_nonce, session_key, temp_data, len)) {
return incoming_con;
} else {
kill_connection(c->lossless_udp, incoming_con);
}
} else {
kill_connection(c->lossless_udp, incoming_con);
}
} else {
break;