Permalink
Browse files

Imported Upstream version 1.4

  • Loading branch information...
1 parent fb9afae commit 6f29c34f6d31cc84c46277ec1d2f6cd95d19973b Ian Jackson committed with Jul 2, 2009
Showing with 29 additions and 6 deletions.
  1. +1 −1 Makefile
  2. +1 −1 Makefile.in
  3. +11 −0 changelog
  4. +14 −2 src/adns.h
  5. +2 −2 src/types.c
View
@@ -23,7 +23,7 @@
# Remember to change ADNS_VERSION_STRING in client/client.h too, and
# possibly library soname (MAJOR and MINOR in settings.make.in).
-DISTVERSION= 1.3
+DISTVERSION= 1.4
srcdir= .
View
@@ -22,7 +22,7 @@
# Remember to change ADNS_VERSION_STRING in client/client.h too, and
# possibly library soname (MAJOR and MINOR in settings.make.in).
-DISTVERSION= 1.3
+DISTVERSION= 1.4
srcdir= @srcdir@
VPATH= @srcdir@
View
@@ -1,3 +1,14 @@
+adns (1.4); urgency=low
+
+ Improvements for multithreaded programs:
+ * New documentation comment in adns.h explaining thread guarantees
+ (or lack of them), replaces `single-threaded' note at the top.
+ * Fix string conversion of adns_r_addr not to use a static buffer
+ (function csp_addr) so as to make thread promise true.
+ * Make an internal variable const-correct (expectdomain in pa_ptr).
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Tue, 17 Oct 2006 17:05:08 +0100
+
adns (1.3); urgency=low
Portability fixes:
View
@@ -1,6 +1,6 @@
/*
* adns.h
- * - adns user-visible API (single-threaded, without any locking)
+ * - adns user-visible API
*/
/*
*
@@ -52,7 +52,7 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
- * $Id: adns.h,v 1.95 2006/04/08 14:36:57 ian Exp $
+ * $Id: adns.h,v 1.96 2006/08/09 11:16:59 ian Exp $
*/
#ifndef ADNS_H_INCLUDED
@@ -401,6 +401,18 @@ typedef struct {
* requested.
*/
+/* Threads:
+ * adns does not use any static modifiable state, so it
+ * is safe to call adns_init several times and then use the
+ * resulting adns_states concurrently.
+ * However, it is NOT safe to make simultaneous calls into
+ * adns using the same adns_state; a single adns_state must be used
+ * only by one thread at a time. You can solve this problem by
+ * having one adns_state per thread, or if that isn't feasible, you
+ * could maintain a pool of adns_states. Unfortunately neither of
+ * these approaches has optimal performance.
+ */
+
int adns_init(adns_state *newstate_r, adns_initflags flags,
FILE *diagfile /*0=>stderr*/);
View
@@ -320,7 +320,7 @@ static int div_addr(void *context, const void *datap_a, const void *datap_b) {
static adns_status csp_addr(vbuf *vb, const adns_rr_addr *rrp) {
const char *ia;
- static char buf[30];
+ char buf[30];
switch (rrp->addr.inet.sin_family) {
case AF_INET:
@@ -736,7 +736,7 @@ static void icb_ptr(adns_query parent, adns_query child) {
static adns_status pa_ptr(const parseinfo *pai, int dmstart,
int max, void *datap) {
- static const char *(expectdomain[])= { DNS_INADDR_ARPA };
+ static const char *const (expectdomain[])= { DNS_INADDR_ARPA };
char **rrp= datap;
adns_status st;

0 comments on commit 6f29c34

Please sign in to comment.