Browse Source

network: moved the response event back to the base of the lookup context and removed the string comparisson to determine which dns mode we are using

Signed-off-by: Leonardo Alminana <leonardo@calyptia.com>
pull/3849/head
Leonardo Alminana 2 months ago
committed by Eduardo Silva
parent
commit
02adc353d5
  1. 4
      include/fluent-bit/flb_network.h
  2. 5
      src/flb_network.c

4
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;

5
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();

Loading…
Cancel
Save