diff --git a/include/fluent-bit/flb_network.h b/include/fluent-bit/flb_network.h index e019e22d9e1..4c654c49310 100644 --- a/include/fluent-bit/flb_network.h +++ b/include/fluent-bit/flb_network.h @@ -44,7 +44,7 @@ struct flb_net_setup { /* maximum of times a keepalive connection can be used */ int keepalive_max_recycle; - /* dns mode : FLB_DNS_USE_TCP, FLB_DNS_USE_UDP */ + /* dns mode : TCP or UDP */ char *dns_mode; }; @@ -60,10 +60,10 @@ struct flb_net_host { /* Defines an async DNS lookup context */ struct flb_dns_lookup_context { + struct mk_event response_event; /* c-ares socket event */ int *udp_timeout_detected; int ares_socket_created; int ares_socket_type; - struct mk_event response_event; /* c-ares socket event */ void *ares_channel; int *result_code; struct mk_event_loop *event_loop; diff --git a/src/flb_network.c b/src/flb_network.c index ba194979bd1..4d163554295 100644 --- a/src/flb_network.c +++ b/src/flb_network.c @@ -744,9 +744,8 @@ int flb_net_getaddrinfo(const char *node, const char *service, struct addrinfo * dns_mode = FLB_DNS_USE_UDP; - if (dns_mode_textual != NULL && - strncasecmp(dns_mode_textual, "TCP", 3) == 0) { - dns_mode = FLB_DNS_USE_TCP; + if (dns_mode_textual != NULL) { + dns_mode = toupper(dns_mode_textual[0]); } event_loop = flb_engine_evl_get();