Merge branch 'develop' into release/1.1.0-alpha3

This commit is contained in:
Willem Toorop 2016-12-08 15:06:25 +01:00
commit f31b2fa233
38 changed files with 262 additions and 223 deletions

View File

@ -784,8 +784,11 @@ _getdns_upstream_shutdown(getdns_upstream *upstream)
}
static int
tls_is_in_transports_list(getdns_context *context) {
for (int i=0; i< context->dns_transport_count;i++) {
tls_is_in_transports_list(getdns_context *context)
{
size_t i;
for (i = 0; i< context->dns_transport_count;i++) {
if (context->dns_transports[i] == GETDNS_TRANSPORT_TLS)
return 1;
}
@ -3076,7 +3079,7 @@ getdns_return_t
_getdns_context_prepare_for_resolution(struct getdns_context *context,
int usenamespaces)
{
int i;
size_t i;
getdns_return_t r;
RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);

View File

@ -224,7 +224,7 @@ struct getdns_context {
/* Context values */
getdns_resolution_t resolution_type;
getdns_namespace_t *namespaces;
int namespace_count;
size_t namespace_count;
uint64_t timeout;
uint64_t idle_timeout;
getdns_redirects_t follow_redirects;

View File

@ -57,9 +57,6 @@
#include "convert.h"
#include "debug.h"
/* stuff to make it compile pedantically */
#define UNUSED_PARAM(x) ((void)(x))
getdns_return_t
getdns_convert_dns_name_to_fqdn(
const getdns_bindata *dns_name_wire_fmt, char **fqdn_as_string)

View File

@ -54,7 +54,7 @@
static char *_json_ptr_first(const struct mem_funcs *mf,
const char *jptr, char *first, size_t first_sz)
const char *jptr, char *first, ssize_t first_sz)
{
const char *next_ref, *k;
char *j;
@ -735,14 +735,13 @@ _getdns_bindata_is_dname(getdns_bindata *bindata)
/**
* private function to pretty print bindata to a gldns_buffer
* @param buf buffer to write to
* @param indent number of spaces to append after newline
* @param bindata the bindata to print
* @return on success the number of written characters
* if an output error is encountered, a negative value
*/
static int
getdns_pp_bindata(gldns_buffer *buf, size_t indent,
getdns_bindata *bindata, int rdata_raw, int json)
getdns_pp_bindata(gldns_buffer *buf, getdns_bindata *bindata,
int rdata_raw, int json)
{
size_t i, p = gldns_buffer_position(buf);
uint8_t *dptr;
@ -887,7 +886,7 @@ getdns_pp_list(gldns_buffer *buf, size_t indent, const getdns_list *list,
GETDNS_RETURN_GOOD)
return -1;
if (getdns_pp_bindata(
buf, indent, bindata_item, 0, json) < 0)
buf, bindata_item, 0, json) < 0)
return -1;
break;
@ -1096,7 +1095,7 @@ getdns_pp_dict(gldns_buffer * buf, size_t indent,
return -1;
} else if (getdns_pp_bindata(
buf, indent, item->i.data.bindata,
buf, item->i.data.bindata,
(strcmp(item->node.key, "rdata_raw") == 0),
json) < 0)
return -1;
@ -1189,7 +1188,7 @@ getdns_pretty_snprint_dict(char *str, size_t size, const getdns_dict *dict)
gldns_buffer_init_frm_data(&buf, str, size);
return getdns_pp_dict(&buf, 0, dict, 0) < 0
? -1 : gldns_buffer_position(&buf);
? -1 : (int)gldns_buffer_position(&buf);
}
char *
@ -1223,7 +1222,7 @@ getdns_pretty_snprint_list(char *str, size_t size, const getdns_list *list)
gldns_buffer_init_frm_data(&buf, str, size);
return getdns_pp_list(&buf, 0, list, 0, 0) < 0
? -1 : gldns_buffer_position(&buf);
? -1 : (int)gldns_buffer_position(&buf);
}
char *
@ -1258,7 +1257,7 @@ getdns_snprint_json_dict(
gldns_buffer_init_frm_data(&buf, str, size);
return getdns_pp_dict(&buf, 0, dict, pretty ? 1 : 2) < 0
? -1 : gldns_buffer_position(&buf);
? -1 : (int)gldns_buffer_position(&buf);
}
char *
@ -1293,7 +1292,7 @@ getdns_snprint_json_list(
gldns_buffer_init_frm_data(&buf, str, size);
return getdns_pp_list(&buf, 0, list, 0, pretty ? 1 : 2) < 0
? -1 : gldns_buffer_position(&buf);
? -1 : (int)gldns_buffer_position(&buf);
}
/* dict.c */

View File

@ -256,7 +256,7 @@ static uint8_t *_dname_label_copy(uint8_t *dst, const uint8_t *src, size_t dst_l
{
uint8_t *r = dst, i;
if (!src || *src + 1 > dst_len)
if (!src || (size_t)*src + 1 > dst_len)
return NULL;
for (i = (*dst++ = *src++); i ; i--)
@ -528,7 +528,7 @@ static chain_head *add_rrset2val_chain(struct mem_funcs *mf,
chain_head *head;
const uint8_t *labels[128], **last_label, **label;
size_t max_labels; /* max labels in common */
ssize_t max_labels; /* max labels in common */
chain_head *max_head;
chain_node *max_node;
@ -1871,7 +1871,7 @@ static int ds_authenticates_keys(struct mem_funcs *mf,
max_supported_digest = ds->rr_i.rr_type[13];
max_supported_result = 0;
if (digest_len != ds->rr_i.nxt - ds->rr_i.rr_type-14
if ((int)digest_len != ds->rr_i.nxt - ds->rr_i.rr_type-14
|| memcmp(digest, ds->rr_i.rr_type+14, digest_len) != 0) {
if (digest != digest_spc)
GETDNS_FREE(*mf, digest);

View File

@ -27,6 +27,7 @@
#include "extension/default_eventloop.h"
#include "debug.h"
#include "types-internal.h"
static uint64_t get_now_plus(uint64_t amount)
{
@ -39,7 +40,8 @@ static uint64_t get_now_plus(uint64_t amount)
}
now = tv.tv_sec * 1000000 + tv.tv_usec;
return (now + amount * 1000) >= now ? now + amount * 1000 : -1;
return (now + amount * 1000) >= now
? now + amount * 1000 : TIMEOUT_FOREVER;
}
static getdns_return_t
@ -151,6 +153,7 @@ default_eventloop_clear(getdns_eventloop *loop, getdns_eventloop_event *event)
static void
default_eventloop_cleanup(getdns_eventloop *loop)
{
(void)loop;
}
static void
@ -181,7 +184,7 @@ default_eventloop_run_once(getdns_eventloop *loop, int blocking)
fd_set readfds, writefds;
int fd, max_fd = -1;
uint64_t now, timeout = (uint64_t)-1;
uint64_t now, timeout = TIMEOUT_FOREVER;
size_t i;
struct timeval tv;
@ -212,7 +215,7 @@ default_eventloop_run_once(getdns_eventloop *loop, int blocking)
if (default_loop->fd_timeout_times[fd] < timeout)
timeout = default_loop->fd_timeout_times[fd];
}
if (max_fd == -1 && timeout == (uint64_t)-1)
if (max_fd == -1 && timeout == TIMEOUT_FOREVER)
return;
if (! blocking || now > timeout) {
@ -223,7 +226,7 @@ default_eventloop_run_once(getdns_eventloop *loop, int blocking)
tv.tv_usec = (timeout - now) % 1000000;
}
if (select(max_fd + 1, &readfds, &writefds, NULL,
(timeout == ((uint64_t)-1) ? NULL : &tv)) < 0) {
(timeout == TIMEOUT_FOREVER ? NULL : &tv)) < 0) {
perror("select() failed");
exit(EXIT_FAILURE);
}

View File

@ -97,6 +97,7 @@ static void
getdns_libev_read_cb(struct ev_loop *l, struct ev_io *io, int revents)
{
getdns_eventloop_event *el_ev = (getdns_eventloop_event *)io->data;
(void)l; (void)revents;
assert(el_ev->read_cb);
el_ev->read_cb(el_ev->userarg);
}
@ -105,14 +106,16 @@ static void
getdns_libev_write_cb(struct ev_loop *l, struct ev_io *io, int revents)
{
getdns_eventloop_event *el_ev = (getdns_eventloop_event *)io->data;
(void)l; (void)revents;
assert(el_ev->write_cb);
el_ev->write_cb(el_ev->userarg);
}
static void
getdns_libev_timeout_cb(struct ev_loop *l, struct ev_timer *timer, int revent)
getdns_libev_timeout_cb(struct ev_loop *l, struct ev_timer *timer, int revents)
{
getdns_eventloop_event *el_ev = (getdns_eventloop_event *)timer->data;
(void)l; (void)revents;
assert(el_ev->timeout_cb);
el_ev->timeout_cb(el_ev->userarg);
}

View File

@ -95,6 +95,7 @@ static getdns_return_t
getdns_libevent_clear(getdns_eventloop *loop, getdns_eventloop_event *el_ev)
{
struct event *my_ev = (struct event *)el_ev->ev;
(void)loop;
assert(my_ev);
@ -110,6 +111,7 @@ static void
getdns_libevent_callback(evutil_socket_t fd, short bits, void *arg)
{
getdns_eventloop_event *el_ev = (getdns_eventloop_event *)arg;
(void)fd;
if (bits & EV_READ) {
assert(el_ev->read_cb);

View File

@ -104,6 +104,7 @@ getdns_libuv_clear(getdns_eventloop *loop, getdns_eventloop_event *el_ev)
poll_timer *my_ev = (poll_timer *)el_ev->ev;
uv_poll_t *my_poll;
uv_timer_t *my_timer;
(void)loop;
assert(my_ev);
@ -141,6 +142,7 @@ static void
getdns_libuv_read_cb(uv_poll_t *poll, int status, int events)
{
getdns_eventloop_event *el_ev = (getdns_eventloop_event *)poll->data;
(void)status; (void)events;
assert(el_ev->read_cb);
DEBUG_UV("enter libuv_read_cb(el_ev = %p, el_ev->ev = %p)\n"
, el_ev, el_ev->ev);
@ -153,6 +155,7 @@ static void
getdns_libuv_write_cb(uv_poll_t *poll, int status, int events)
{
getdns_eventloop_event *el_ev = (getdns_eventloop_event *)poll->data;
(void)status; (void)events;
assert(el_ev->write_cb);
DEBUG_UV("enter libuv_write_cb(el_ev = %p, el_ev->ev = %p)\n"
, el_ev, el_ev->ev);

View File

@ -328,7 +328,7 @@ rrinternal_write_typeclassttl(gldns_buffer* strbuf, uint8_t* rr, size_t len,
/** find delimiters for type */
static const char*
rrinternal_get_delims(gldns_rdf_type rdftype, uint16_t r_cnt, uint16_t r_max)
rrinternal_get_delims(gldns_rdf_type rdftype, size_t r_cnt, size_t r_max)
{
switch(rdftype) {
case GLDNS_RDF_TYPE_B64 :
@ -463,7 +463,7 @@ rrinternal_parse_unknown(gldns_buffer* strbuf, char* token, size_t token_len,
static int
rrinternal_parse_rdf(gldns_buffer* strbuf, char* token, size_t token_len,
uint8_t* rr, size_t rr_len, size_t* rr_cur_len, gldns_rdf_type rdftype,
uint16_t rr_type, uint16_t r_cnt, uint16_t r_max, size_t dname_len,
uint16_t rr_type, size_t r_cnt, size_t r_max, size_t dname_len,
uint8_t* origin, size_t origin_len)
{
size_t len;
@ -613,7 +613,7 @@ rrinternal_parse_rdata(gldns_buffer* strbuf, char* token, size_t token_len,
uint8_t* origin, size_t origin_len)
{
const gldns_rr_descriptor *desc = gldns_rr_descript((uint16_t)rr_type);
uint16_t r_cnt, r_min, r_max;
size_t r_cnt, r_min, r_max;
size_t rr_cur_len = dname_len + 10, pre_data_pos, token_strlen;
int was_unknown_rr_format = 0, parens = 0, status, quoted;
const char* delimiters;
@ -693,7 +693,7 @@ rrinternal_parse_rdata(gldns_buffer* strbuf, char* token, size_t token_len,
gldns_buffer_position(strbuf));
}
/* write rdata length */
gldns_write_uint16(rr+dname_len+8, rr_cur_len-dname_len-10);
gldns_write_uint16(rr+dname_len+8, (uint16_t)(rr_cur_len-dname_len-10));
*rr_len = rr_cur_len;
return GLDNS_WIREPARSE_ERR_OK;
}
@ -1369,7 +1369,7 @@ int gldns_str2wire_time_buf(const char* str, uint8_t* rd, size_t* len)
if (tm.tm_sec < 0 || tm.tm_sec > 59)
return GLDNS_WIREPARSE_ERR_SYNTAX_TIME;
gldns_write_uint32(rd, gldns_mktime_from_utc(&tm));
gldns_write_uint32(rd, (uint32_t)gldns_mktime_from_utc(&tm));
} else {
/* handle it as 32 bits timestamp */
char *end;
@ -1932,7 +1932,7 @@ int gldns_str2wire_tag_buf(const char* str, uint8_t* rd, size_t* len)
if(!isalnum((unsigned char)*ptr))
return RET_ERR(GLDNS_WIREPARSE_ERR_SYNTAX_TAG, ptr-str);
}
rd[0] = slen;
rd[0] = (uint8_t)slen;
memmove(rd+1, str, slen);
*len = slen+1;
return GLDNS_WIREPARSE_ERR_OK;
@ -2000,7 +2000,7 @@ int gldns_str2wire_hip_buf(const char* str, uint8_t* rd, size_t* len)
return RET_ERR_SHIFT(e, s-(char*)str);
if(pklen > 65535)
return RET_ERR(GLDNS_WIREPARSE_ERR_LABEL_OVERFLOW, s-(char*)str+65535);
gldns_write_uint16(rd+2, pklen);
gldns_write_uint16(rd+2, (uint16_t)pklen);
*len = 4 + hitlen + pklen;
return GLDNS_WIREPARSE_ERR_OK;

View File

@ -668,7 +668,7 @@ int gldns_wire2str_rdata_scan(uint8_t** d, size_t* dlen, char** s,
uint8_t* origd = *d;
char* origs = *s;
size_t origdlen = *dlen, origslen = *slen;
uint16_t r_cnt, r_max;
size_t r_cnt, r_max;
gldns_rdf_type rdftype;
int w = 0, n;
@ -789,8 +789,9 @@ int gldns_wire2str_dname_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
}
/* spool label characters, end with '.' */
if(in_buf && *dlen < labellen) labellen = *dlen;
else if(!in_buf && pos+labellen > pkt+pktlen)
if(in_buf && *dlen < (size_t)labellen)
labellen = (uint8_t)*dlen;
else if(!in_buf && pos+(size_t)labellen > pkt+pktlen)
labellen = (uint8_t)(pkt + pktlen - pos);
for(i=0; i<(unsigned)labellen; i++) {
w += dname_char_print(s, slen, *pos++);
@ -1983,10 +1984,10 @@ int gldns_wire2str_edns_scan(uint8_t** data, size_t* data_len, char** str,
w += gldns_str_print(str, str_len, " ; udp: %u", (unsigned)udpsize);
if(rdatalen) {
if(*data_len < rdatalen) {
if((size_t)*data_len < rdatalen) {
w += gldns_str_print(str, str_len,
" ; Error EDNS rdata too short; ");
rdatalen = *data_len;
rdatalen = (uint16_t)*data_len;
}
w += print_edns_opts(str, str_len, *data, rdatalen);
(*data) += rdatalen;

View File

@ -312,7 +312,7 @@ getdns_return_t
_getdns_list_copy(const struct getdns_list * srclist,
struct getdns_list ** dstlist)
{
int i;
size_t i;
getdns_return_t retval;
if (!dstlist)

View File

@ -97,7 +97,7 @@ getdns_dict* getdns_pubkey_pin_create_from_string(
const char* str)
{
BIO *bio = NULL;
int i;
size_t i;
uint8_t buf[SHA256_DIGEST_LENGTH];
char inbuf[B64_ENCODED_SHA256_LENGTH + 1];
getdns_bindata value = { .size = SHA256_DIGEST_LENGTH, .data = buf };
@ -436,7 +436,7 @@ _getdns_verify_pinset_match(const sha256_pin_t *pinset,
/* digest the cert with sha256 */
len = i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), NULL);
if (len > sizeof(raw)) {
if (len > (int)sizeof(raw)) {
DEBUG_STUB("%s %-35s: Pubkey %d is larger than "PRIsz" octets\n",
STUB_DEBUG_SETUP_TLS, __FUNCTION__, i, sizeof(raw));
continue;

View File

@ -47,6 +47,7 @@
static const uint8_t *
apl_n_rdf_end(const uint8_t *pkt, const uint8_t *pkt_end, const uint8_t *rdf)
{
(void)pkt;
return rdf < pkt_end ? rdf + 1 : NULL;
}
static getdns_return_t
@ -107,6 +108,7 @@ apl_afdpart_rdf_end(
const uint8_t *pkt, const uint8_t *pkt_end, const uint8_t *rdf)
{
const uint8_t *end = rdf + (rdf[-1] & 0x7F);
(void)(pkt);
return end <= pkt_end ? end : NULL;
}
static getdns_return_t
@ -335,6 +337,7 @@ static const uint8_t *
hip_pk_algorithm_rdf_end(
const uint8_t *pkt, const uint8_t *pkt_end, const uint8_t *rdf)
{
(void)(pkt);
return rdf + 4 > pkt_end ? NULL
: rdf + 4 + *rdf + gldns_read_uint16(rdf + 2) > pkt_end ? NULL
: rdf + 1;
@ -397,6 +400,7 @@ static _getdns_rdf_special hip_pk_algorithm = {
static const uint8_t *
hip_hit_rdf_end(const uint8_t *pkt, const uint8_t *pkt_end, const uint8_t *rdf)
{
(void)(pkt);
return rdf + 3 > pkt_end ? NULL
: rdf + 3 + rdf[-1] + gldns_read_uint16(rdf + 1) > pkt_end ? NULL
: rdf + 1;
@ -467,6 +471,7 @@ static const uint8_t *
hip_public_key_rdf_end(
const uint8_t *pkt, const uint8_t *pkt_end, const uint8_t *rdf)
{
(void)(pkt);
return rdf + 2 > pkt_end ? NULL
: rdf + 2 + rdf[-2] + gldns_read_uint16(rdf) > pkt_end ? NULL
: rdf + 2 + rdf[-2] + gldns_read_uint16(rdf);
@ -537,222 +542,222 @@ static _getdns_rdf_special hip_public_key = {
static _getdns_rdata_def a_rdata[] = {
{ "ipv4_address" , GETDNS_RDF_A }};
{ "ipv4_address" , GETDNS_RDF_A , NULL }};
static _getdns_rdata_def ns_rdata[] = {
{ "nsdname" , GETDNS_RDF_N_C }};
{ "nsdname" , GETDNS_RDF_N_C , NULL }};
static _getdns_rdata_def md_rdata[] = {
{ "madname" , GETDNS_RDF_N_C }};
{ "madname" , GETDNS_RDF_N_C , NULL }};
static _getdns_rdata_def cname_rdata[] = {
{ "cname" , GETDNS_RDF_N_C }};
{ "cname" , GETDNS_RDF_N_C , NULL }};
static _getdns_rdata_def soa_rdata[] = {
{ "mname" , GETDNS_RDF_N_C },
{ "rname" , GETDNS_RDF_N_C },
{ "serial" , GETDNS_RDF_I4 },
{ "refresh" , GETDNS_RDF_I4 },
{ "retry" , GETDNS_RDF_I4 },
{ "expire" , GETDNS_RDF_I4 },
{ "minimum" , GETDNS_RDF_I4 }};
{ "mname" , GETDNS_RDF_N_C , NULL },
{ "rname" , GETDNS_RDF_N_C , NULL },
{ "serial" , GETDNS_RDF_I4 , NULL },
{ "refresh" , GETDNS_RDF_I4 , NULL },
{ "retry" , GETDNS_RDF_I4 , NULL },
{ "expire" , GETDNS_RDF_I4 , NULL },
{ "minimum" , GETDNS_RDF_I4 , NULL }};
static _getdns_rdata_def mg_rdata[] = {
{ "mgmname" , GETDNS_RDF_N_C }};
{ "mgmname" , GETDNS_RDF_N_C , NULL }};
static _getdns_rdata_def mr_rdata[] = {
{ "newname" , GETDNS_RDF_N_C }};
{ "newname" , GETDNS_RDF_N_C , NULL }};
static _getdns_rdata_def null_rdata[] = {
{ "anything" , GETDNS_RDF_X }};
{ "anything" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def wks_rdata[] = {
{ "address" , GETDNS_RDF_A },
{ "protocol" , GETDNS_RDF_I1 },
{ "bitmap" , GETDNS_RDF_X }};
{ "address" , GETDNS_RDF_A , NULL },
{ "protocol" , GETDNS_RDF_I1 , NULL },
{ "bitmap" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def ptr_rdata[] = {
{ "ptrdname" , GETDNS_RDF_N_C }};
{ "ptrdname" , GETDNS_RDF_N_C , NULL }};
static _getdns_rdata_def hinfo_rdata[] = {
{ "cpu" , GETDNS_RDF_S },
{ "os" , GETDNS_RDF_S }};
{ "cpu" , GETDNS_RDF_S , NULL },
{ "os" , GETDNS_RDF_S , NULL }};
static _getdns_rdata_def minfo_rdata[] = {
{ "rmailbx" , GETDNS_RDF_N_C },
{ "emailbx" , GETDNS_RDF_N_C }};
{ "rmailbx" , GETDNS_RDF_N_C , NULL },
{ "emailbx" , GETDNS_RDF_N_C , NULL }};
static _getdns_rdata_def mx_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "exchange" , GETDNS_RDF_N_C }};
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "exchange" , GETDNS_RDF_N_C , NULL }};
static _getdns_rdata_def txt_rdata[] = {
{ "txt_strings" , GETDNS_RDF_S_M }};
{ "txt_strings" , GETDNS_RDF_S_M , NULL }};
static _getdns_rdata_def rp_rdata[] = {
{ "mbox_dname" , GETDNS_RDF_N },
{ "txt_dname" , GETDNS_RDF_N }};
{ "mbox_dname" , GETDNS_RDF_N , NULL },
{ "txt_dname" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def afsdb_rdata[] = {
{ "subtype" , GETDNS_RDF_I2 },
{ "hostname" , GETDNS_RDF_N }};
{ "subtype" , GETDNS_RDF_I2 , NULL },
{ "hostname" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def x25_rdata[] = {
{ "psdn_address" , GETDNS_RDF_S }};
{ "psdn_address" , GETDNS_RDF_S , NULL }};
static _getdns_rdata_def isdn_rdata[] = {
{ "isdn_address" , GETDNS_RDF_S },
{ "sa" , GETDNS_RDF_S }};
{ "isdn_address" , GETDNS_RDF_S , NULL },
{ "sa" , GETDNS_RDF_S , NULL }};
static _getdns_rdata_def rt_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "intermediate_host" , GETDNS_RDF_N }};
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "intermediate_host" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def nsap_rdata[] = {
{ "nsap" , GETDNS_RDF_X }};
{ "nsap" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def sig_rdata[] = {
{ "sig_obsolete" , GETDNS_RDF_X }};
{ "sig_obsolete" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def key_rdata[] = {
{ "key_obsolete" , GETDNS_RDF_X }};
{ "key_obsolete" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def px_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "map822" , GETDNS_RDF_N },
{ "mapx400" , GETDNS_RDF_N }};
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "map822" , GETDNS_RDF_N , NULL },
{ "mapx400" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def gpos_rdata[] = {
{ "longitude" , GETDNS_RDF_S },
{ "latitude" , GETDNS_RDF_S },
{ "altitude" , GETDNS_RDF_S }};
{ "longitude" , GETDNS_RDF_S , NULL },
{ "latitude" , GETDNS_RDF_S , NULL },
{ "altitude" , GETDNS_RDF_S , NULL }};
static _getdns_rdata_def aaaa_rdata[] = {
{ "ipv6_address" , GETDNS_RDF_AAAA }};
{ "ipv6_address" , GETDNS_RDF_AAAA , NULL }};
static _getdns_rdata_def loc_rdata[] = {
{ "loc_obsolete" , GETDNS_RDF_X }};
{ "loc_obsolete" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def nxt_rdata[] = {
{ "nxt_obsolete" , GETDNS_RDF_X }};
{ "nxt_obsolete" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def srv_rdata[] = {
{ "priority" , GETDNS_RDF_I2 },
{ "weight" , GETDNS_RDF_I2 },
{ "port" , GETDNS_RDF_I2 },
{ "target" , GETDNS_RDF_N }};
{ "priority" , GETDNS_RDF_I2 , NULL },
{ "weight" , GETDNS_RDF_I2 , NULL },
{ "port" , GETDNS_RDF_I2 , NULL },
{ "target" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def atma_rdata[] = {
{ "format" , GETDNS_RDF_X }};
{ "format" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def naptr_rdata[] = {
{ "order" , GETDNS_RDF_I2 },
{ "preference" , GETDNS_RDF_I2 },
{ "flags" , GETDNS_RDF_S },
{ "service" , GETDNS_RDF_S },
{ "regexp" , GETDNS_RDF_S },
{ "replacement" , GETDNS_RDF_N }};
{ "order" , GETDNS_RDF_I2 , NULL },
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "flags" , GETDNS_RDF_S , NULL },
{ "service" , GETDNS_RDF_S , NULL },
{ "regexp" , GETDNS_RDF_S , NULL },
{ "replacement" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def kx_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "exchanger" , GETDNS_RDF_N }};
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "exchanger" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def cert_rdata[] = {
{ "type" , GETDNS_RDF_I2 },
{ "key_tag" , GETDNS_RDF_I2 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "certificate_or_crl" , GETDNS_RDF_B }};
{ "type" , GETDNS_RDF_I2 , NULL },
{ "key_tag" , GETDNS_RDF_I2 , NULL },
{ "algorithm" , GETDNS_RDF_I1 , NULL },
{ "certificate_or_crl" , GETDNS_RDF_B , NULL }};
static _getdns_rdata_def a6_rdata[] = {
{ "a6_obsolete" , GETDNS_RDF_X }};
{ "a6_obsolete" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def dname_rdata[] = {
{ "target" , GETDNS_RDF_N }};
{ "target" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def opt_rdata[] = {
{ "options" , GETDNS_RDF_R },
{ "option_code" , GETDNS_RDF_I2 },
{ "option_data" , GETDNS_RDF_X_S }};
{ "options" , GETDNS_RDF_R , NULL },
{ "option_code" , GETDNS_RDF_I2 , NULL },
{ "option_data" , GETDNS_RDF_X_S , NULL }};
static _getdns_rdata_def apl_rdata[] = {
{ "apitems" , GETDNS_RDF_R },
{ "address_family" , GETDNS_RDF_I2 },
{ "prefix" , GETDNS_RDF_I1 },
{ "apitems" , GETDNS_RDF_R , NULL },
{ "address_family" , GETDNS_RDF_I2 , NULL },
{ "prefix" , GETDNS_RDF_I1 , NULL },
{ "n" , GETDNS_RDF_SPECIAL, &apl_n },
{ "afdpart" , GETDNS_RDF_SPECIAL, &apl_afdpart }};
static _getdns_rdata_def ds_rdata[] = {
{ "key_tag" , GETDNS_RDF_I2 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "digest_type" , GETDNS_RDF_I1 },
{ "digest" , GETDNS_RDF_X }};
{ "key_tag" , GETDNS_RDF_I2 , NULL },
{ "algorithm" , GETDNS_RDF_I1 , NULL },
{ "digest_type" , GETDNS_RDF_I1 , NULL },
{ "digest" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def sshfp_rdata[] = {
{ "algorithm" , GETDNS_RDF_I1 },
{ "fp_type" , GETDNS_RDF_I1 },
{ "fingerprint" , GETDNS_RDF_X }};
{ "algorithm" , GETDNS_RDF_I1 , NULL },
{ "fp_type" , GETDNS_RDF_I1 , NULL },
{ "fingerprint" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def ipseckey_rdata[] = {
{ "algorithm" , GETDNS_RDF_I1 },
{ "gateway_type" , GETDNS_RDF_I1 },
{ "precedence" , GETDNS_RDF_I1 },
{ "algorithm" , GETDNS_RDF_I1 , NULL },
{ "gateway_type" , GETDNS_RDF_I1 , NULL },
{ "precedence" , GETDNS_RDF_I1 , NULL },
{ "gateway" , GETDNS_RDF_SPECIAL, &ipseckey_gateway },
{ "public_key" , GETDNS_RDF_B }};
{ "public_key" , GETDNS_RDF_B , NULL }};
static _getdns_rdata_def rrsig_rdata[] = {
{ "type_covered" , GETDNS_RDF_I2 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "labels" , GETDNS_RDF_I1 },
{ "original_ttl" , GETDNS_RDF_I4 },
{ "signature_expiration" , GETDNS_RDF_T },
{ "signature_inception" , GETDNS_RDF_T },
{ "key_tag" , GETDNS_RDF_I2 },
{ "signers_name" , GETDNS_RDF_N },
{ "signature" , GETDNS_RDF_B }};
{ "type_covered" , GETDNS_RDF_I2 , NULL },
{ "algorithm" , GETDNS_RDF_I1 , NULL },
{ "labels" , GETDNS_RDF_I1 , NULL },
{ "original_ttl" , GETDNS_RDF_I4 , NULL },
{ "signature_expiration" , GETDNS_RDF_T , NULL },
{ "signature_inception" , GETDNS_RDF_T , NULL },
{ "key_tag" , GETDNS_RDF_I2 , NULL },
{ "signers_name" , GETDNS_RDF_N , NULL },
{ "signature" , GETDNS_RDF_B , NULL }};
static _getdns_rdata_def nsec_rdata[] = {
{ "next_domain_name" , GETDNS_RDF_N },
{ "type_bit_maps" , GETDNS_RDF_X }};
{ "next_domain_name" , GETDNS_RDF_N , NULL },
{ "type_bit_maps" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def dnskey_rdata[] = {
{ "flags" , GETDNS_RDF_I2 },
{ "protocol" , GETDNS_RDF_I1 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "public_key" , GETDNS_RDF_B }};
{ "flags" , GETDNS_RDF_I2 , NULL },
{ "protocol" , GETDNS_RDF_I1 , NULL },
{ "algorithm" , GETDNS_RDF_I1 , NULL },
{ "public_key" , GETDNS_RDF_B , NULL }};
static _getdns_rdata_def dhcid_rdata[] = {
{ "dhcid_opaque" , GETDNS_RDF_B }};
{ "dhcid_opaque" , GETDNS_RDF_B , NULL }};
static _getdns_rdata_def nsec3_rdata[] = {
{ "hash_algorithm" , GETDNS_RDF_I1 },
{ "flags" , GETDNS_RDF_I1 },
{ "iterations" , GETDNS_RDF_I2 },
{ "salt" , GETDNS_RDF_X_C },
{ "next_hashed_owner_name" , GETDNS_RDF_B32_C},
{ "type_bit_maps" , GETDNS_RDF_X }};
{ "hash_algorithm" , GETDNS_RDF_I1 , NULL },
{ "flags" , GETDNS_RDF_I1 , NULL },
{ "iterations" , GETDNS_RDF_I2 , NULL },
{ "salt" , GETDNS_RDF_X_C , NULL },
{ "next_hashed_owner_name" , GETDNS_RDF_B32_C , NULL },
{ "type_bit_maps" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def nsec3param_rdata[] = {
{ "hash_algorithm" , GETDNS_RDF_I1 },
{ "flags" , GETDNS_RDF_I1 },
{ "iterations" , GETDNS_RDF_I2 },
{ "salt" , GETDNS_RDF_X_C }};
{ "hash_algorithm" , GETDNS_RDF_I1 , NULL },
{ "flags" , GETDNS_RDF_I1 , NULL },
{ "iterations" , GETDNS_RDF_I2 , NULL },
{ "salt" , GETDNS_RDF_X_C , NULL }};
static _getdns_rdata_def tlsa_rdata[] = {
{ "certificate_usage" , GETDNS_RDF_I1 },
{ "selector" , GETDNS_RDF_I1 },
{ "matching_type" , GETDNS_RDF_I1 },
{ "certificate_association_data", GETDNS_RDF_X }};
{ "certificate_usage" , GETDNS_RDF_I1 , NULL },
{ "selector" , GETDNS_RDF_I1 , NULL },
{ "matching_type" , GETDNS_RDF_I1 , NULL },
{ "certificate_association_data", GETDNS_RDF_X , NULL }};
static _getdns_rdata_def hip_rdata[] = {
{ "pk_algorithm" , GETDNS_RDF_SPECIAL, &hip_pk_algorithm },
{ "hit" , GETDNS_RDF_SPECIAL, &hip_hit },
{ "public_key" , GETDNS_RDF_SPECIAL, &hip_public_key },
{ "rendezvous_servers" , GETDNS_RDF_N_M }};
{ "rendezvous_servers" , GETDNS_RDF_N_M , NULL }};
static _getdns_rdata_def csync_rdata[] = {
{ "serial" , GETDNS_RDF_I4 },
{ "flags" , GETDNS_RDF_I2 },
{ "type_bit_maps" , GETDNS_RDF_X }};
{ "serial" , GETDNS_RDF_I4 , NULL },
{ "flags" , GETDNS_RDF_I2 , NULL },
{ "type_bit_maps" , GETDNS_RDF_X , NULL }};
static _getdns_rdata_def spf_rdata[] = {
{ "text" , GETDNS_RDF_S_M }};
{ "text" , GETDNS_RDF_S_M , NULL }};
static _getdns_rdata_def nid_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "node_id" , GETDNS_RDF_AA }};
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "node_id" , GETDNS_RDF_AA , NULL }};
static _getdns_rdata_def l32_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "locator32" , GETDNS_RDF_A }};
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "locator32" , GETDNS_RDF_A , NULL }};
static _getdns_rdata_def l64_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "locator64" , GETDNS_RDF_AA }};
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "locator64" , GETDNS_RDF_AA , NULL }};
static _getdns_rdata_def lp_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "fqdn" , GETDNS_RDF_N }};
{ "preference" , GETDNS_RDF_I2 , NULL },
{ "fqdn" , GETDNS_RDF_N , NULL }};
static _getdns_rdata_def eui48_rdata[] = {
{ "eui48_address" , GETDNS_RDF_X6 }};
{ "eui48_address" , GETDNS_RDF_X6 , NULL }};
static _getdns_rdata_def eui64_rdata[] = {
{ "eui64_address" , GETDNS_RDF_X8 }};
{ "eui64_address" , GETDNS_RDF_X8 , NULL }};
static _getdns_rdata_def tkey_rdata[] = {
{ "algorithm" , GETDNS_RDF_N },
{ "inception" , GETDNS_RDF_T },
{ "expiration" , GETDNS_RDF_T },
{ "mode" , GETDNS_RDF_I2 },
{ "error" , GETDNS_RDF_I2 },
{ "key_data" , GETDNS_RDF_X_S },
{ "other_data" , GETDNS_RDF_X_S }};
{ "algorithm" , GETDNS_RDF_N , NULL },
{ "inception" , GETDNS_RDF_T , NULL },
{ "expiration" , GETDNS_RDF_T , NULL },
{ "mode" , GETDNS_RDF_I2 , NULL },
{ "error" , GETDNS_RDF_I2 , NULL },
{ "key_data" , GETDNS_RDF_X_S , NULL },
{ "other_data" , GETDNS_RDF_X_S , NULL }};
static _getdns_rdata_def tsig_rdata[] = {
{ "algorithm" , GETDNS_RDF_N },
{ "time_signed" , GETDNS_RDF_T6 },
{ "fudge" , GETDNS_RDF_I2 },
{ "mac" , GETDNS_RDF_X_S },
{ "original_id" , GETDNS_RDF_I2 },
{ "error" , GETDNS_RDF_I2 },
{ "other_data" , GETDNS_RDF_X_S }};
{ "algorithm" , GETDNS_RDF_N , NULL },
{ "time_signed" , GETDNS_RDF_T6 , NULL },
{ "fudge" , GETDNS_RDF_I2 , NULL },
{ "mac" , GETDNS_RDF_X_S , NULL },
{ "original_id" , GETDNS_RDF_I2 , NULL },
{ "error" , GETDNS_RDF_I2 , NULL },
{ "other_data" , GETDNS_RDF_X_S , NULL }};
static _getdns_rdata_def uri_rdata[] = {
{ "priority" , GETDNS_RDF_I2 },
{ "weight" , GETDNS_RDF_I2 },
{ "target" , GETDNS_RDF_S_L }};
{ "priority" , GETDNS_RDF_I2 , NULL },
{ "weight" , GETDNS_RDF_I2 , NULL },
{ "target" , GETDNS_RDF_S_L , NULL }};
static _getdns_rdata_def caa_rdata[] = {
{ "flags" , GETDNS_RDF_I1 },
{ "tag" , GETDNS_RDF_S },
{ "value" , GETDNS_RDF_S_L }};
{ "flags" , GETDNS_RDF_I1 , NULL },
{ "tag" , GETDNS_RDF_S , NULL },
{ "value" , GETDNS_RDF_S_L , NULL }};
static _getdns_rdata_def dlv_rdata[] = {
{ "key_tag" , GETDNS_RDF_I2 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "digest_type" , GETDNS_RDF_I1 },
{ "digest" , GETDNS_RDF_X }};
{ "key_tag" , GETDNS_RDF_I2 , NULL },
{ "algorithm" , GETDNS_RDF_I1 , NULL },
{ "digest_type" , GETDNS_RDF_I1 , NULL },
{ "digest" , GETDNS_RDF_X , NULL }};
static _getdns_rr_def _getdns_rr_defs[] = {
{ NULL, NULL, 0 },

View File

@ -138,7 +138,7 @@ typedef struct _getdns_rdata_def {
typedef struct _getdns_rr_def {
const char *name;
const _getdns_rdata_def *rdata;
int n_rdata_fields;
size_t n_rdata_fields;
} _getdns_rr_def;
const _getdns_rr_def *_getdns_rr_def_lookup(uint16_t rr_type);

View File

@ -75,7 +75,7 @@ find_rrtype(_getdns_rr_iter *i)
/* Past the last RR in the pkt */
if (i->pkt &&
GLDNS_QDCOUNT(i->pkt) + GLDNS_ANCOUNT(i->pkt) +
(size_t)GLDNS_QDCOUNT(i->pkt) + GLDNS_ANCOUNT(i->pkt) +
GLDNS_NSCOUNT(i->pkt) + GLDNS_ARCOUNT(i->pkt) <= i->n)
goto done;

View File

@ -88,13 +88,13 @@ _getdns_rr_iter_section(_getdns_rr_iter *i)
{
return !i->pkt ? (i->nxt - i->rr_type == 4 ? SECTION_QUESTION
: SECTION_ANSWER )
: i->n < GLDNS_QDCOUNT(i->pkt) ? SECTION_QUESTION
: i->n < GLDNS_QDCOUNT(i->pkt)
: i->n < (size_t)GLDNS_QDCOUNT(i->pkt) ? SECTION_QUESTION
: i->n < (size_t)GLDNS_QDCOUNT(i->pkt)
+ GLDNS_ANCOUNT(i->pkt) ? SECTION_ANSWER
: i->n < GLDNS_QDCOUNT(i->pkt)
: i->n < (size_t)GLDNS_QDCOUNT(i->pkt)
+ GLDNS_ANCOUNT(i->pkt)
+ GLDNS_NSCOUNT(i->pkt) ? SECTION_AUTHORITY
: i->n < GLDNS_QDCOUNT(i->pkt)
: i->n < (size_t)GLDNS_QDCOUNT(i->pkt)
+ GLDNS_ANCOUNT(i->pkt)
+ GLDNS_NSCOUNT(i->pkt)
+ GLDNS_ARCOUNT(i->pkt) ? SECTION_ADDITIONAL

View File

@ -108,9 +108,9 @@ typedef struct tcp_connection {
getdns_eventloop_event event;
uint8_t *read_buf;
size_t read_buf_len;
ssize_t read_buf_len;
uint8_t *read_pos;
size_t to_read;
ssize_t to_read;
tcp_to_write *to_write;
size_t to_answer;
@ -359,7 +359,7 @@ static void tcp_read_cb(void *userarg)
(void) loop->vmt->schedule(loop, conn->fd,
DOWNSTREAM_IDLE_TIMEOUT, &conn->event);
if ((bytes_read = read(conn->fd, conn->read_pos, conn->to_read)) == -1) {
if ((bytes_read = read(conn->fd, conn->read_pos, conn->to_read)) < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
return; /* Come back to do the read later */
@ -749,9 +749,9 @@ static getdns_return_t add_listeners(listen_set *set)
break;
if (setsockopt(l->fd, SOL_SOCKET, SO_REUSEADDR,
&enable, sizeof(int)) < 0)
&enable, sizeof(int)) < 0) {
; /* Ignore */
}
if (bind(l->fd, (struct sockaddr *)&l->addr,
l->addr_len) == -1)
/* IO error */

View File

@ -654,7 +654,7 @@ stub_tcp_read(int fd, getdns_tcp_state *tcp, struct mem_funcs *mf)
tcp->to_read = 2; /* Packet size */
}
read = recv(fd, (void *)tcp->read_pos, tcp->to_read, 0);
if (read == -1) {
if (read < 0) {
if (_getdns_EWOULDBLOCK)
return STUB_TCP_WOULDBLOCK;
else
@ -663,7 +663,7 @@ stub_tcp_read(int fd, getdns_tcp_state *tcp, struct mem_funcs *mf)
/* Remote end closed the socket */
/* TODO: Try to reconnect */
return STUB_TCP_ERROR;
} else if (read> tcp->to_read) {
} else if ((size_t)read > tcp->to_read) {
return STUB_TCP_ERROR;
}
tcp->to_read -= read;
@ -771,12 +771,12 @@ stub_tcp_write(int fd, getdns_tcp_state *tcp, getdns_network_req *netreq)
(struct sockaddr *)&(netreq->upstream->addr),
netreq->upstream->addr_len);
#endif
if ((written == -1 && (_getdns_EWOULDBLOCK ||
if ((written < 0 && (_getdns_EWOULDBLOCK ||
/* Add the error case where the connection is in progress which is when
a cookie is not available (e.g. when doing the first request to an
upstream). We must let the handshake complete since non-blocking. */
_getdns_EINPROGRESS)) ||
written < pkt_len + 2) {
(size_t)written < pkt_len + 2) {
/* We couldn't write the whole packet.
* We have to return with STUB_TCP_AGAIN.

View File

@ -151,6 +151,7 @@ getdns_sync_cb(getdns_context *context, getdns_callback_type_t callback_type,
getdns_dict *response, void *userarg, getdns_transaction_t transaction_id)
{
getdns_sync_data *data = (getdns_sync_data *)userarg;
(void)context; (void)callback_type; (void)transaction_id;
assert(data);

View File

@ -75,7 +75,7 @@
int
main (int argc, char** argv)
main ()
{
int number_failed;
SRunner *sr ;

View File

@ -451,6 +451,8 @@
void *userarg,
getdns_transaction_t transaction_id)
{
(void)context; (void)response; (void)userarg;
callback_called++;
if(callback_type == GETDNS_CALLBACK_CANCEL)
@ -483,6 +485,7 @@
*/
void verify_getdns_cancel_callback(struct extracted_response *ex_response)
{
(void)ex_response;
/*
* increment callback_called global to prove callback was called.
*/

View File

@ -320,6 +320,7 @@ void destroy_callbackfn(struct getdns_context *context,
void *userarg,
getdns_transaction_t transaction_id) {
int* flag = (int*)userarg;
(void)callback_type; (void)transaction_id;
*flag = 1;
getdns_dict_destroy(response);
getdns_context_destroy(context);
@ -339,6 +340,7 @@ void callbackfn(struct getdns_context *context,
{
typedef void (*fn_ptr)(struct extracted_response *ex_response);
fn_ptr fn = userarg;
(void)context; (void)transaction_id;
/*
* If userarg is NULL, either a negative test case
@ -378,7 +380,7 @@ void callbackfn(struct getdns_context *context,
void update_callbackfn(struct getdns_context *context,
getdns_context_code_t changed_item)
{
(void)context;
ck_assert_msg(changed_item == expected_changed_item,
"Expected changed_item == %d, got %d",
changed_item, expected_changed_item);

View File

@ -267,6 +267,7 @@
void verify_getdns_context_destroy(struct extracted_response *ex_response)
{
(void)ex_response;
/*
* Sleep for a second to make getdns_context_destroy() wait.
*/

View File

@ -243,6 +243,7 @@ void timeout_3_cb(struct getdns_context *context,
getdns_callback_type_t callback_type,
struct getdns_dict * response,
void *userarg, getdns_transaction_t transaction_id) {
(void)response; (void)transaction_id;
timeout_thread_data *tdata = (timeout_thread_data*)userarg;
tdata->num_callbacks++;
if (callback_type == GETDNS_CALLBACK_TIMEOUT) {

View File

@ -79,7 +79,7 @@
struct getdns_list *answer = NULL;
char *keys[3] = { "ten", "eleven", "twelve" };
uint32_t values[3] = { 10, 11, 12 };
int i;
size_t i;
size_t length;
struct getdns_bindata *key = NULL;
char string_buffer[20] = "";

View File

@ -46,6 +46,7 @@
void run_event_loop_impl(struct getdns_context* context, void* eventloop) {
struct ev_loop* loop = (struct ev_loop*) eventloop;
(void)context;
ev_run(loop, 0);
}

View File

@ -42,6 +42,7 @@
void run_event_loop_impl(struct getdns_context* context, void* eventloop) {
struct event_base* base = (struct event_base*) eventloop;
(void)context;
event_base_dispatch(base);
}

View File

@ -42,6 +42,7 @@
void run_event_loop_impl(struct getdns_context* context, void* eventloop) {
uv_loop_t* loop = (uv_loop_t*) eventloop;
(void)context;
uv_run(loop, UV_RUN_DEFAULT);
}

View File

@ -37,9 +37,11 @@
#include "getdns/getdns_extra.h"
void run_event_loop_impl(struct getdns_context* context, void* eventloop) {
(void)eventloop;
getdns_context_run(context);
}
void* create_eventloop_impl(struct getdns_context* context) {
(void)context;
return NULL;
}

View File

@ -193,6 +193,8 @@ void transport_cb(struct getdns_context *context,
struct getdns_dict * response,
void *userarg, getdns_transaction_t transaction_id) {
/* Don't really care about the answer*/
(void)context; (void)callback_type; (void)response;
(void)userarg; (void)transaction_id;
return;
}

View File

@ -214,7 +214,7 @@ tst_getnames(void)
size_t index;
size_t llen;
uint32_t ansint;
int i;
size_t i;
getdns_return_t result;
getdns_data_type dtype;
struct getdns_dict *dict = NULL;
@ -508,7 +508,7 @@ tst_create(void)
* runs unit tests against list management routines
*/
int
main(int argc, char *argv[])
main()
{
tstmsg_prog_begin("tests_dict");

View File

@ -404,7 +404,7 @@ tst_create(void)
* runs unit tests against list management routines
*/
int
main(int argc, char *argv[])
main()
{
tstmsg_prog_begin("tests_list");

View File

@ -57,6 +57,8 @@ this_callbackfn(struct getdns_context *this_context,
struct getdns_dict *this_response,
void *this_userarg, getdns_transaction_t this_transaction_id)
{
(void)this_context; (void)this_userarg;
if (this_callback_type == GETDNS_CALLBACK_COMPLETE) { /* This is a callback with data */
char *res = getdns_pretty_print_dict(this_response);
fprintf(stdout, "%s\n", res);

View File

@ -132,8 +132,8 @@ static int get_rrclass(const char *t)
}
static getdns_return_t
fill_transport_list(getdns_context *context, char *transport_list_str,
getdns_transport_list_t *transports, size_t *transport_count)
fill_transport_list(char *transport_list_str,
getdns_transport_list_t *transports, size_t *transport_count)
{
size_t max_transports = *transport_count;
*transport_count = 0;
@ -370,6 +370,7 @@ void callback(getdns_context *context, getdns_callback_type_t callback_type,
getdns_dict *response, void *userarg, getdns_transaction_t trans_id)
{
char *response_str;
(void)context; (void)userarg;
/* This is a callback with data */;
if (response && !quiet && (response_str = json ?
@ -553,7 +554,8 @@ int parse_config_file(const char *fn, int report_open_failure)
getdns_return_t parse_args(int argc, char **argv)
{
getdns_return_t r = GETDNS_RETURN_GOOD;
size_t i, j, klass;
size_t j;
int i, klass;
char *arg, *c, *endptr;
int t, print_api_info = 0, print_trust_anchors = 0;
getdns_list *upstream_list = NULL;
@ -957,7 +959,7 @@ getdns_return_t parse_args(int argc, char **argv)
}
getdns_transport_list_t transports[10];
size_t transport_count = sizeof(transports);
if ((r = fill_transport_list(context, argv[i], transports, &transport_count)) ||
if ((r = fill_transport_list(argv[i], transports, &transport_count)) ||
(r = getdns_context_set_dns_transport_list(context,
transport_count, transports))){
fprintf(stderr, "Could not set transports\n");
@ -1039,13 +1041,13 @@ next: ;
if (pubkey_pinset && upstream_count) {
getdns_dict *upstream;
/* apply the accumulated pubkey pinset to all upstreams: */
for (i = 0; i < upstream_count; i++) {
if (r = getdns_list_get_dict(upstream_list, i, &upstream), r) {
fprintf(stderr, "Failed to get upstream "PRIsz" when adding pinset\n", i);
for (j = 0; j < upstream_count; j++) {
if (r = getdns_list_get_dict(upstream_list, j, &upstream), r) {
fprintf(stderr, "Failed to get upstream "PRIsz" when adding pinset\n", j);
return r;
}
if (r = getdns_dict_set_list(upstream, "tls_pubkey_pinset", pubkey_pinset), r) {
fprintf(stderr, "Failed to set pubkey pinset on upstream "PRIsz"\n", i);
fprintf(stderr, "Failed to set pubkey pinset on upstream "PRIsz"\n", j);
return r;
}
}

View File

@ -119,7 +119,7 @@ struct getdns_upstream;
#define GETDNS_STR_KEY_NSCOUNT "nscount"
#define GETDNS_STR_KEY_ARCOUNT "arcount"
#define TIMEOUT_FOREVER ((int64_t)-1)
#define TIMEOUT_FOREVER ((uint64_t)0xFFFFFFFFFFFFFFFF)
#define ASSERT_UNREACHABLE 0
#define GETDNS_TRANSPORTS_MAX 3

View File

@ -353,6 +353,7 @@ static int my_timer_del(struct ub_event* ev)
static int my_signal_add(struct ub_event* ub_ev, struct timeval* tv)
{
(void)ub_ev; (void)tv;
/* Only unbound daaemon workers use signals */
DEBUG_SCHED("UB_LOOP ERROR: signal_add()\n");
return -1;
@ -360,6 +361,7 @@ static int my_signal_add(struct ub_event* ub_ev, struct timeval* tv)
static int my_signal_del(struct ub_event* ub_ev)
{
(void)ub_ev;
/* Only unbound daaemon workers use signals */
DEBUG_SCHED("UB_LOOP ERROR: signal_del()\n");
return -1;
@ -412,7 +414,7 @@ static struct ub_event* my_event_new(struct ub_event_base* base, int fd,
ev->added = 0;
ev->fd = fd;
ev->bits = bits;
ev->timeout = (uint64_t)-1;
ev->timeout = TIMEOUT_FOREVER;
ev->cb = cb;
ev->arg = arg;
#ifdef USE_WINSOCK

View File

@ -891,7 +891,7 @@ static int _srv_cmp(const void *a, const void *b)
static void _rfc2782_sort(_srv_rr *start, _srv_rr *end)
{
int running_sum, n;
uint32_t running_sum, n;
_srv_rr *i, *j, swap;
/* First move all SRVs with weight 0 to the beginning of the list */
@ -1254,6 +1254,8 @@ getdns_return_t
getdns_apply_network_result(getdns_network_req* netreq,
int rcode, void *pkt, int pkt_len, int sec, char* why_bogus)
{
(void)why_bogus;
netreq->dnssec_status = sec == 0 ? GETDNS_DNSSEC_INSECURE
: sec == 2 ? GETDNS_DNSSEC_SECURE
: GETDNS_DNSSEC_BOGUS;