/* Delete from UDP remote hash table */
char tuple[64];
engine = stream->sc->engine;
- silc_snprintf(tuple, sizeof(tuple), "%d%s", stream->remote_udp->remote_port,
- stream->remote_udp->remote_ip);
+ silc_snprintf(tuple, sizeof(tuple), "%d%s",
+ stream->remote_udp->remote_port
+ stream->remote_udp->remote_ip);
silc_mutex_lock(engine->lock);
silc_hash_table_del(engine->udp_remote, tuple);
silc_mutex_unlock(engine->lock);
connauth->timeout_secs = timeout_secs;
connauth->ske = ske;
+ ske->refcnt++;
return connauth;
}
{
if (connauth->public_keys)
silc_dlist_uninit(connauth->public_keys);
+
+ /* Free reference */
+ silc_ske_free(connauth->ske);
+
silc_free(connauth);
}
SILC_LOG_DEBUG(("Start"));
- /* Send FAILURE packet */
- SILC_PUT32_MSB(SILC_AUTH_FAILED, error);
- silc_packet_send(connauth->ske->stream, SILC_PACKET_FAILURE, 0, error, 4);
+ if (!connauth->aborted) {
+ /* Send FAILURE packet */
+ SILC_PUT32_MSB(SILC_AUTH_FAILED, error);
+ silc_packet_send(connauth->ske->stream, SILC_PACKET_FAILURE, 0, error, 4);
- /* Call completion callback */
- connauth->completion(connauth, FALSE, connauth->context);
+ /* Call completion callback */
+ connauth->completion(connauth, FALSE, connauth->context);
+ }
silc_packet_stream_unlink(connauth->ske->stream,
&silc_connauth_stream_cbs, connauth);
SILC_LOG_ERROR(("Authentication failed"));
- /* Send FAILURE packet */
- SILC_PUT32_MSB(SILC_AUTH_FAILED, error);
- silc_packet_send(connauth->ske->stream, SILC_PACKET_FAILURE, 0, error, 4);
+ if (!connauth->aborted) {
+ /* Send FAILURE packet */
+ SILC_PUT32_MSB(SILC_AUTH_FAILED, error);
+ silc_packet_send(connauth->ske->stream, SILC_PACKET_FAILURE, 0, error, 4);
- /* Call completion callback */
- connauth->completion(connauth, FALSE, connauth->context);
+ /* Call completion callback */
+ connauth->completion(connauth, FALSE, connauth->context);
+ }
silc_packet_stream_unlink(connauth->ske->stream,
&silc_connauth_stream_cbs, connauth);