diff --git a/src/context.c b/src/context.c index 495217f4..a7a84ca4 100644 --- a/src/context.c +++ b/src/context.c @@ -683,7 +683,7 @@ _getdns_upstream_shutdown(getdns_upstream *upstream) if (upstream->tls_auth_state != GETDNS_AUTH_NONE) upstream->past_tls_auth_state = upstream->tls_auth_state; - DEBUG_STUB("%s %-35s: FD: %d Stats on shutdown: TR=%d,TT=%d,CC=%d,CSF=%d,CS=%d,AS=%d\n", + DEBUG_STUB("%s %-35s: FD: %d Upstream Stats: Resp=%d,Timeouts=%d,Conns=%d,Conn_fails=%d,Conn_shutdowns=%d,Auth=%d\n", STUB_DEBUG_CLEANUP, __FUNCTION__, upstream->fd, (int)upstream->total_responses, (int)upstream->total_timeouts, (int)upstream->conn_completed, (int)upstream->conn_setup_failed, @@ -701,8 +701,11 @@ _getdns_upstream_shutdown(getdns_upstream *upstream) && upstream->total_responses == 0) || (upstream->conn_completed >= GETDNS_CONN_ATTEMPTS && upstream->total_responses == 0 && - upstream->total_timeouts > GETDNS_TRANSPORT_FAIL_MULT)) + upstream->total_timeouts > GETDNS_TRANSPORT_FAIL_MULT)) { + DEBUG_STUB("%s %-35s: FD: %d BACKING OFF THIS UPSTREAM! \n", + STUB_DEBUG_CLEANUP, __FUNCTION__, upstream->fd); upstream->conn_state = GETDNS_CONN_BACKOFF; + } // Reset per connection counters upstream->queries_sent = 0; upstream->responses_received = 0; diff --git a/src/debug.h b/src/debug.h index e106cf67..91051435 100644 --- a/src/debug.h +++ b/src/debug.h @@ -37,7 +37,7 @@ #include "config.h" -#define STUB_DEBUG_ENTRY "-> ENTRY: " +#define STUB_DEBUG_ENTRY "=> ENTRY: " #define STUB_DEBUG_SETUP "--- SETUP: " #define STUB_DEBUG_SETUP_TLS "--- SETUP(TLS): " #define STUB_DEBUG_TSIG "--- TSIG: " diff --git a/src/stub.c b/src/stub.c index ef9362e9..94627d24 100644 --- a/src/stub.c +++ b/src/stub.c @@ -251,8 +251,8 @@ match_edns_opt_rr(uint16_t code, uint8_t *response, size_t response_len, size_t data_len = rr_iter->nxt - rr_iter->pos; (void) gldns_wire2str_rr_scan( &data, &data_len, &str, &str_len, (uint8_t *)rr_iter->pkt, rr_iter->pkt_end - rr_iter->pkt); - DEBUG_STUB("%s %-35s: OPT RR: %s\n", - STUB_DEBUG_CLEANUP, __FUNCTION__, str_spc); + DEBUG_STUB("%s %-35s: OPT RR: %s", + STUB_DEBUG_READ, __FUNCTION__, str_spc); #endif /* OPT found, now search for the specified option */ @@ -347,7 +347,7 @@ process_keepalive( else { upstream->keepalive_timeout = server_keepalive; DEBUG_STUB("%s %-35s: FD: %d Server Keepalive used: %d ms\n", - STUB_DEBUG_CLEANUP, __FUNCTION__, upstream->fd, + STUB_DEBUG_READ, __FUNCTION__, upstream->fd, (int)server_keepalive); } }