+/* $OpenLDAP$ */
/*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/* Portions
#include "ldap-int.h"
-static char ** decode_answer LDAP_P(( unsigned char *answer, int len ));
+static char ** decode_answer LDAP_P(( unsigned char *answer, ber_len_t len ));
#define MAX_TO_SORT 32
* array.
*/
char **
-ldap_getdxbyname( char *domain )
+ldap_getdxbyname( const char *domain )
{
unsigned char buf[ PACKETSZ ];
char **dxs;
memset( buf, 0, sizeof( buf ));
+#ifdef LDAP_R_COMPILE
+ ldap_pvt_thread_mutex_lock(&ldap_int_resolv_mutex);
+#endif
+
if (( rc = res_search( domain, C_IN, T_TXT, buf, sizeof( buf ))) < 0
|| ( dxs = decode_answer( buf, rc )) == NULL ) {
/*
}
}
+#ifdef LDAP_R_COMPILE
+ ldap_pvt_thread_mutex_unlock(&ldap_int_resolv_mutex);
+#endif
+
return( dxs );
}
static char **
-decode_answer( unsigned char *answer, int len )
+decode_answer( unsigned char *answer, ber_len_t len )
{
HEADER *hp;
char buf[ 256 ], **dxs;
rr_len = _getshort( p );
p += INT16SZ;
if ( class == C_IN && type == T_TXT ) {
- int i, n, pref, txt_len;
+ int pref, txt_len;
char *q, *r;
q = (char *)p;