diff options
author | Roman Arutyunyan <arut@nginx.com> | 2016-01-28 15:28:20 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2016-01-28 15:28:20 +0300 |
commit | aa8fa81e4234de0e6f9ced5b1fd220993357f989 (patch) | |
tree | ddbfd0482ea8a0f3dd1f7b5d43511dac5fd79c9e /src/core/ngx_resolver.h | |
parent | c8c44f74783d699474b32a59f525a3ef4dfbecf5 (diff) |
Resolver: TCP support.
Resend DNS query over TCP once UDP response came truncated.
Diffstat (limited to 'src/core/ngx_resolver.h')
-rw-r--r-- | src/core/ngx_resolver.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/core/ngx_resolver.h b/src/core/ngx_resolver.h index ab4ae74ee..3165abd49 100644 --- a/src/core/ngx_resolver.h +++ b/src/core/ngx_resolver.h @@ -36,12 +36,19 @@ #define NGX_RESOLVER_MAX_RECURSION 50 +typedef struct ngx_resolver_s ngx_resolver_t; + + typedef struct { ngx_connection_t *udp; + ngx_connection_t *tcp; struct sockaddr *sockaddr; socklen_t socklen; ngx_str_t server; ngx_log_t log; + ngx_buf_t *read_buf; + ngx_buf_t *write_buf; + ngx_resolver_t *resolver; } ngx_resolver_connection_t; @@ -93,13 +100,18 @@ typedef struct { time_t valid; uint32_t ttl; + unsigned tcp:1; +#if (NGX_HAVE_INET6) + unsigned tcp6:1; +#endif + ngx_uint_t last_connection; ngx_resolver_ctx_t *waiting; } ngx_resolver_node_t; -typedef struct { +struct ngx_resolver_s { /* has to be pointer because of "incomplete type" */ ngx_event_t *event; void *dummy; @@ -133,11 +145,12 @@ typedef struct { #endif time_t resend_timeout; + time_t tcp_timeout; time_t expire; time_t valid; ngx_uint_t log_level; -} ngx_resolver_t; +}; struct ngx_resolver_ctx_s { |