Skip to content

Commit

Permalink
network: moved the response event back to the base of the lookup cont…
Browse files Browse the repository at this point in the history
…ext and removed the string comparisson to determine which dns mode we are using

Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Jul 26, 2021
1 parent 8d64f29 commit 02adc35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/fluent-bit/flb_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/flb_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 02adc35

Please sign in to comment.