diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-01-26 05:17:34 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-01-26 05:17:34 +0100 |
commit | 76d955efa5fcd46fd325015d6cd3a389f8d9bb93 (patch) | |
tree | 69956b73a9ca9f692a5a95759eb7dedffea62e12 /src/peer.c | |
parent | 9fe7f35ce87dceb368c7ddffd7f6902dca24b97a (diff) | |
download | fastd-76d955efa5fcd46fd325015d6cd3a389f8d9bb93.tar fastd-76d955efa5fcd46fd325015d6cd3a389f8d9bb93.zip |
Get rid of long_ago variable, use timeout helpers
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -186,7 +186,7 @@ static void init_handshake(fastd_context_t *ctx, fastd_peer_t *peer) { } void fastd_peer_handle_resolve(fastd_context_t *ctx, fastd_peer_t *peer, fastd_remote_t *remote, size_t n_addresses, const fastd_peer_address_t *addresses) { - remote->last_resolve_return = ctx->now; + remote->resolving = false; free(remote->addresses); remote->addresses = malloc(n_addresses*sizeof(fastd_peer_address_t)); @@ -207,16 +207,16 @@ static void setup_peer(fastd_context_t *ctx, fastd_peer_t *peer) { fastd_remote_t *remote; for (remote = peer->remotes; remote; remote = remote->next) { - remote->last_resolve = ctx->conf->long_ago; - remote->last_resolve_return = ctx->conf->long_ago; + remote->last_resolve_timeout = ctx->now; + remote->resolving = false; } peer->next_remote = peer->remotes; - peer->last_handshake = ctx->conf->long_ago; + peer->last_handshake_timeout = ctx->now; peer->last_handshake_address.sa.sa_family = AF_UNSPEC; - peer->last_handshake_response = ctx->conf->long_ago; + peer->last_handshake_response_timeout = ctx->now; peer->last_handshake_response_address.sa.sa_family = AF_UNSPEC; if (!peer->protocol_state) |