diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-12-18 21:00:44 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-12-18 21:00:44 +0100 |
commit | 224ea7b0815187d2a638808e8a50fb29fda832f6 (patch) | |
tree | aabc417ce70e0d83258b8b51439e8f2ccc4b8ffe /src/resolve.c | |
parent | 766a0c145dad84b9af35b2bebc032be71509b3df (diff) | |
download | fastd-224ea7b0815187d2a638808e8a50fb29fda832f6.tar fastd-224ea7b0815187d2a638808e8a50fb29fda832f6.zip |
Convert type names to _t convention
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/resolve.c b/src/resolve.c index 642fd67..66da479 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -33,16 +33,16 @@ #include <pthread.h> -typedef struct _resolv_arg { - fastd_context *ctx; +typedef struct resolv_arg { + fastd_context_t *ctx; pthread_t master_thread; char *hostname; - fastd_peer_address constraints; -} resolv_arg; + fastd_peer_address_t constraints; +} resolv_arg_t; static void* resolve_peer(void *varg) { - resolv_arg *arg = varg; + resolv_arg_t *arg = varg; struct addrinfo hints; struct addrinfo *res = NULL; @@ -64,12 +64,12 @@ static void* resolve_peer(void *varg) { pr_verbose(arg->ctx, "resolving host `%s' failed: %s", arg->hostname, gai_strerror(gai_ret)); error = true; } - else if (res->ai_addrlen > sizeof(fastd_peer_address) || (res->ai_addr->sa_family != AF_INET && res->ai_addr->sa_family != AF_INET6)) { + else if (res->ai_addrlen > sizeof(fastd_peer_address_t) || (res->ai_addr->sa_family != AF_INET && res->ai_addr->sa_family != AF_INET6)) { pr_warn(arg->ctx, "resolving host `%s': unsupported address returned", arg->hostname); error = true; } - fastd_resolve_return ret; + fastd_resolve_return_t ret; memset(&ret, 0, sizeof(ret)); ret.hostname = arg->hostname; @@ -93,7 +93,7 @@ static void* resolve_peer(void *varg) { return NULL; } -void fastd_resolve_peer(fastd_context *ctx, fastd_peer *peer) { +void fastd_resolve_peer(fastd_context_t *ctx, fastd_peer_t *peer) { if (timespec_after(&peer->last_resolve, &peer->last_resolve_return)) { pr_debug(ctx, "not resolving %P as there is already a resolve running", peer); return; @@ -102,7 +102,7 @@ void fastd_resolve_peer(fastd_context *ctx, fastd_peer *peer) { if (timespec_diff(&ctx->now, &peer->last_resolve) < ctx->conf->min_resolve_interval*1000) { pr_debug(ctx, "not resolving %P as it has been resolved a short time ago", peer); - fastd_resolve_return ret; + fastd_resolve_return_t ret; memset(&ret, 0, sizeof(ret)); ret.hostname = strdup(peer->config->hostname); @@ -118,7 +118,7 @@ void fastd_resolve_peer(fastd_context *ctx, fastd_peer *peer) { pr_verbose(ctx, "resolving host `%s' for peer %P...", peer->config->hostname, peer); peer->last_resolve = ctx->now; - resolv_arg *arg = malloc(sizeof(resolv_arg)); + resolv_arg_t *arg = malloc(sizeof(resolv_arg_t)); arg->ctx = ctx; arg->master_thread = pthread_self(); |