Skip to content

Commit b32ee61

Browse files
committed
Merge branch 'develop' into devel/huitema-develop
2 parents b80ccba + 2a49696 commit b32ee61

21 files changed

Lines changed: 231 additions & 94 deletions

ChangeLog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
* 2017-04-??: Version 1.1.0
2+
* More fine grained control over TLS upstream retry and back off
3+
behaviour with getdns_context_set_tls_backoff_time() and
4+
getdns_context_set_tls_connection_retries().
5+
* New round robin over the available upstreams feaure.
6+
Enable with getdns_context_set_round_robin_upstreams()
7+
* Bugfix: Queue requests when no sockets available for outgoing queries.
8+
* Obey the outstanding query limit with STUB resolution mode too.
9+
* Updated stubby config file
10+
* Draft MDNS client implementation by Christian Huitema.
11+
Enable with --enable-draft-mdns-support to configure
12+
* bugfix: Let synchronous queries use fds > MAX_FDSETSIZE;
13+
By moving default eventloop from select to poll
14+
Thanks Neil Cook
15+
* bugfix: authentication failure for self signed cert + only pinset
16+
* bugfix: issue with session re-use making authentication appear to fail
17+
118
* 2017-01-13: Version 1.0.0
219
* edns0_cookies extension enabled by default (per RFC7873)
320
* dnssec_roadblock_avoidance enabled by default (per RFC8027)

Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ install: all getdns.pc getdns_ext_event.pc @INSTALL_GETDNS_QUERY@ @INSTALL_STUBB
6666
$(INSTALL) -m 644 getdns_ext_event.pc $(DESTDIR)$(libdir)/pkgconfig
6767
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)/spec
6868
$(INSTALL) -m 644 $(srcdir)/spec/index.html $(DESTDIR)$(docdir)/spec
69-
$(INSTALL) -m 644 $(srcdir)/spec/getdns*tgz $(DESTDIR)$(docdir)/spec || true
7069
cd src && $(MAKE) $@
7170
cd doc && $(MAKE) $@
7271
@echo "***"
@@ -232,12 +231,13 @@ $(distdir):
232231
cp $(srcdir)/src/test/*.good $(distdir)/src/test
233232
cp $(srcdir)/src/compat/*.[ch] $(distdir)/src/compat
234233
cp $(srcdir)/src/util/*.[ch] $(distdir)/src/util
234+
cp -r $(srcdir)/src/util/orig-headers $(distdir)/src/util
235+
cp -r $(srcdir)/src/util/auxiliary $(distdir)/src/util
235236
cp $(srcdir)/src/gldns/*.[ch] $(distdir)/src/gldns
236237
cp $(srcdir)/doc/Makefile.in $(distdir)/doc
237238
cp $(srcdir)/doc/*.in $(distdir)/doc
238239
cp $(srcdir)/doc/manpgaltnames $(distdir)/doc
239240
cp $(srcdir)/spec/*.html $(distdir)/spec
240-
cp $(srcdir)/spec/*.tgz $(distdir)/spec || true
241241
cp $(srcdir)/spec/example/Makefile.in $(distdir)/spec/example
242242
cp $(srcdir)/spec/example/*.[ch] $(distdir)/spec/example
243243
cp $(srcdir)/src/tools/Makefile.in $(distdir)/src/tools

README.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Traditional access to DNS data from applications has several limitations:
1919

2020
* Sophisticated uses of the DNS (things like IDNA and DNSSEC validation) require considerable application work, possibly by application developers with little experience with the vagaries of DNS.
2121

22-
getdns also provides a experimental DNS Privacy enabled client called 'stubby' - see below for more details.
22+
getdns also provides an experimental DNS Privacy enabled client called 'stubby' - see below for more details.
2323

2424
## Motivation for providing the API
2525

@@ -78,7 +78,7 @@ before building.
7878
As well as building the getdns library 2 other tools are installed by default by the above process:
7979

8080
* getdns_query: a command line test script wrapper for getdns
81-
* stubby: a experimental DNS Privacy enabled client
81+
* stubby: an experimental DNS Privacy enabled client
8282

8383
Note: If you only want to build stubby, then use the `--enable-stub-only` and `--without-libidn` options when running 'configure'.
8484

@@ -197,18 +197,7 @@ Stub mode does not support:
197197

198198
# Known Issues
199199

200-
* The synchronous lookup functions will not work when new file descriptors
201-
needed for the lookup will be larger than `FD_SETSIZE`. This is because
202-
the synchronous functions use a "default" event loop under the hood
203-
which is based on `select()` and thus inherits the limits that `select()` has.
204-
205-
If you need only slightly more file descriptors, it is possible to enlarge
206-
the `FD_SETSIZE` with the `--with-fd-setsize=`*`size`* flag to `configure`.
207-
208-
To resolve, use the asynchronous functions with an event loop extension for
209-
libevent, libev or libuv. Note that the asynchronous functions will have
210-
the same problem when used in combination with `getdns_context_run()`, which
211-
also uses the default event loop.
200+
* None
212201

213202
# Supported Platforms
214203

@@ -342,8 +331,10 @@ Contributors
342331
* Neel Goyal, Verisign, Inc.
343332
* Bryan Graham, Verisign, Inc.
344333
* Robert Groenenberg
334+
* Jim Hague, Sinodun
345335
* Paul Hoffman
346336
* Scott Hollenbeck, Verising, Inc.
337+
* Christian Huitema
347338
* Shumon Huque, Verisign Labs
348339
* Jelte Janssen
349340
* Guillem Jover
@@ -358,6 +349,7 @@ Contributors
358349
* Joel Purra
359350
* Tom Pusateri
360351
* Prithvi Ranganath, Verisign, Inc.
352+
* Hoda Rohani, NLnet Labs
361353
* Rushi Shah, Verisign, Inc.
362354
* Vinay Soni, Verisign, Inc.
363355
* Melinda Shore, No Mountain Software LLC

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ sinclude(./m4/ax_check_compile_flag.m4)
3737
sinclude(./m4/pkg.m4)
3838

3939
AC_INIT([getdns], [1.1.0], [users@getdnsapi.net], [], [https://getdnsapi.net])
40-
AC_SUBST(RELEASE_CANDIDATE, [-alpha3])
40+
AC_SUBST(RELEASE_CANDIDATE, [-rc1])
4141

4242
# Set current date from system if not set
4343
AC_ARG_WITH([current-date],
@@ -47,7 +47,7 @@ AC_ARG_WITH([current-date],
4747
[CURRENT_DATE="`date -u +%Y-%m-%dT%H:%M:%SZ`"])
4848

4949
AC_SUBST(GETDNS_VERSION, ["AC_PACKAGE_VERSION$RELEASE_CANDIDATE"])
50-
AC_SUBST(GETDNS_NUMERIC_VERSION, [0x0100A300])
50+
AC_SUBST(GETDNS_NUMERIC_VERSION, [0x0100C100])
5151
AC_SUBST(API_VERSION, ["December 2015"])
5252
AC_SUBST(API_NUMERIC_VERSION, [0x07df0c00])
5353
GETDNS_COMPILATION_COMMENT="AC_PACKAGE_NAME $GETDNS_VERSION configured on $CURRENT_DATE for the $API_VERSION version of the API"

doc/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ uninstall:
7777

7878
clean:
7979
for x in $(MANPAGES3); do rm -f $$($(srcdir)/manpgaltnames $$x); done
80+
rm -f tagfile
8081
rm -rf $(DOCDIRS) $(MANPAGES3)
8182

8283
distclean : clean

src/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ TAGFILES =
16571657
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
16581658
# a tag file that is based on the input files it reads.
16591659

1660-
GENERATE_TAGFILE =
1660+
GENERATE_TAGFILE = ../doc/tagfile
16611661

16621662
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
16631663
# in the class index. If set to NO only the inherited external classes

src/context.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ _getdns_upstream_shutdown(getdns_upstream *upstream)
756756
uint16_t conn_retries = upstream->upstreams->tls_connection_retries;
757757
/* [TLS1]TODO: This arbitrary logic at the moment - review and improve!*/
758758
if (upstream->conn_setup_failed >= conn_retries
759-
|| (upstream->conn_shutdowns >= conn_retries*GETDNS_TRANSPORT_FAIL_MULT
759+
|| ((int)upstream->conn_shutdowns >= conn_retries*GETDNS_TRANSPORT_FAIL_MULT
760760
&& upstream->total_responses == 0)
761761
|| (upstream->conn_completed >= conn_retries &&
762762
upstream->total_responses == 0 &&
@@ -938,7 +938,7 @@ upstream_init(getdns_upstream *upstream,
938938
upstream->keepalive_shutdown = 0;
939939
upstream->keepalive_timeout = 0;
940940
/* How is this upstream doing on UDP? */
941-
upstream->to_retry = 2;
941+
upstream->to_retry = 1;
942942
upstream->back_off = 1;
943943
upstream->udp_responses = 0;
944944
upstream->udp_timeouts = 0;

src/context.h

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,32 @@ typedef struct getdns_upstream {
131131
char addr_str[INET6_ADDRSTRLEN];
132132
#endif
133133

134-
/* How is this upstream doing over UDP? */
135-
int to_retry;
136-
int back_off;
134+
/**
135+
* How is this upstream doing over UDP?
136+
*
137+
* to_retry = 1, back_off = 1, in context.c:upstream_init()
138+
*
139+
* When querying over UDP, first a upstream is selected which to_retry
140+
* value > 0 in stub.c:upstream_select().
141+
*
142+
* Every time a udp request times out, to_retry is decreased, and if
143+
* it reaches 0, it is set to minus back_off in
144+
* stub.c:stub_next_upstream().
145+
*
146+
* to_retry will become > 0 again. because each time an upstream is
147+
* selected for a UDP query in stub.c:upstream_select(), all to_retry
148+
* counters <= 0 are incremented.
149+
*
150+
* On continuous failure, the stubs are less likely to be reselected,
151+
* because each time to_retry is set to minus back_off, in
152+
* stub.c:stub_next_upstream(), the back_off value is doubled.
153+
*
154+
* Finally, if all upstreams are failing, the upstreams with the
155+
* smallest back_off value will be selected, and the back_off value
156+
* decremented by one.
157+
*/
158+
int to_retry; /* (initialized to 1) */
159+
int back_off; /* (initialized to 1) */
137160
size_t udp_responses;
138161
size_t udp_timeouts;
139162

src/general.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,14 @@ _getdns_netreq_change_state(
305305
uint64_t now_ms;
306306
getdns_network_req *prev;
307307

308-
if (!netreq || !netreq->owner->is_dns_request)
308+
if (!netreq)
309309
return;
310310

311+
if (!netreq->owner->is_dns_request) {
312+
netreq->state = new_state;
313+
return;
314+
}
315+
311316
context = netreq->owner->context;
312317

313318
if (netreq->state != NET_REQ_IN_FLIGHT) {

0 commit comments

Comments
 (0)