diff options
author | louiz’ <louiz@louiz.org> | 2017-03-29 23:32:43 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-03-29 23:32:43 +0200 |
commit | 1a09c965eb3723cdaab9ea556f30ffbc7f09a6dd (patch) | |
tree | 8da20afbb4520f71bbdd9ed6fc2ff301bb7be992 /src/network | |
parent | 52b795d11976802cfec12d886fca508047ffed89 (diff) | |
download | biboumi-1a09c965eb3723cdaab9ea556f30ffbc7f09a6dd.tar.gz biboumi-1a09c965eb3723cdaab9ea556f30ffbc7f09a6dd.tar.bz2 biboumi-1a09c965eb3723cdaab9ea556f30ffbc7f09a6dd.tar.xz biboumi-1a09c965eb3723cdaab9ea556f30ffbc7f09a6dd.zip |
Remove two sneaky log_debug
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/resolver.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/network/resolver.cpp b/src/network/resolver.cpp index db7fb32..ef54ba2 100644 --- a/src/network/resolver.cpp +++ b/src/network/resolver.cpp @@ -1,7 +1,7 @@ #include <network/dns_handler.hpp> #include <utils/timed_events.hpp> #include <network/resolver.hpp> -#include <string.h> +#include <cstring> #include <arpa/inet.h> #include <netinet/in.h> #ifdef UDNS_FOUND @@ -41,8 +41,8 @@ Resolver::Resolver(): void Resolver::resolve(const std::string& hostname, const std::string& port, SuccessCallbackType success_cb, ErrorCallbackType error_cb) { - this->error_cb = error_cb; - this->success_cb = success_cb; + this->error_cb = std::move(error_cb); + this->success_cb = std::move(success_cb); #ifdef UDNS_FOUND this->port = port; #endif @@ -52,8 +52,7 @@ void Resolver::resolve(const std::string& hostname, const std::string& port, int Resolver::call_getaddrinfo(const char *name, const char* port, int flags) { - struct addrinfo hints; - memset(&hints, 0, sizeof(struct addrinfo)); + struct addrinfo hints{}; hints.ai_flags = flags; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; @@ -111,7 +110,7 @@ void Resolver::start_resolving(const std::string& hostname, const std::string& p // And finally, we try a DNS resolution auto hostname6_resolved = [](dns_ctx*, dns_rr_a6* result, void* data) { - Resolver* resolver = static_cast<Resolver*>(data); + auto resolver = static_cast<Resolver*>(data); resolver->on_hostname6_resolved(result); resolver->after_resolved(); std::free(result); @@ -119,7 +118,7 @@ void Resolver::start_resolving(const std::string& hostname, const std::string& p auto hostname4_resolved = [](dns_ctx*, dns_rr_a4* result, void* data) { - Resolver* resolver = static_cast<Resolver*>(data); + auto resolver = static_cast<Resolver*>(data); resolver->on_hostname4_resolved(result); resolver->after_resolved(); std::free(result); |