mirror of https://github.com/getdnsapi/getdns.git
Fix some compiler warnings on OS X
This commit is contained in:
parent
5d8894495a
commit
ef12b0e764
32
src/stub.c
32
src/stub.c
|
@ -385,7 +385,7 @@ tcp_connect(getdns_upstream *upstream, getdns_transport_list_t transport)
|
|||
{
|
||||
int fd = -1;
|
||||
DEBUG_STUB("%s %-35s: Creating TCP connection: %p\n", STUB_DEBUG_SETUP,
|
||||
__FUNCTION__, upstream);
|
||||
__FUNCTION__, (void*)upstream);
|
||||
if ((fd = socket(upstream->addr.ss_family, SOCK_STREAM, IPPROTO_TCP)) == -1)
|
||||
return -1;
|
||||
|
||||
|
@ -481,7 +481,7 @@ static void
|
|||
stub_cleanup(getdns_network_req *netreq)
|
||||
{
|
||||
DEBUG_STUB("%s %-35s: MSG: %p\n",
|
||||
STUB_DEBUG_CLEANUP, __FUNCTION__, netreq);
|
||||
STUB_DEBUG_CLEANUP, __FUNCTION__, (void*)netreq);
|
||||
getdns_dns_req *dnsreq = netreq->owner;
|
||||
getdns_network_req *r, *prev_r;
|
||||
getdns_upstream *upstream;
|
||||
|
@ -562,7 +562,7 @@ void
|
|||
_getdns_cancel_stub_request(getdns_network_req *netreq)
|
||||
{
|
||||
DEBUG_STUB("%s %-35s: MSG: %p\n",
|
||||
STUB_DEBUG_CLEANUP, __FUNCTION__, netreq);
|
||||
STUB_DEBUG_CLEANUP, __FUNCTION__, (void*)netreq);
|
||||
stub_cleanup(netreq);
|
||||
if (netreq->fd >= 0) {
|
||||
#ifdef USE_WINSOCK
|
||||
|
@ -578,7 +578,7 @@ stub_timeout_cb(void *userarg)
|
|||
{
|
||||
getdns_network_req *netreq = (getdns_network_req *)userarg;
|
||||
DEBUG_STUB("%s %-35s: MSG: %p\n",
|
||||
STUB_DEBUG_CLEANUP, __FUNCTION__, netreq);
|
||||
STUB_DEBUG_CLEANUP, __FUNCTION__, (void*)netreq);
|
||||
stub_cleanup(netreq);
|
||||
netreq->state = NET_REQ_TIMED_OUT;
|
||||
/* Handle upstream*/
|
||||
|
@ -1297,7 +1297,7 @@ stub_udp_read_cb(void *userarg)
|
|||
getdns_upstream *upstream = netreq->upstream;
|
||||
ssize_t read;
|
||||
DEBUG_STUB("%s %-35s: MSG: %p \n", STUB_DEBUG_READ,
|
||||
__FUNCTION__, netreq);
|
||||
__FUNCTION__, (void*)netreq);
|
||||
|
||||
GETDNS_CLEAR_EVENT(dnsreq->loop, &netreq->event);
|
||||
|
||||
|
@ -1330,7 +1330,7 @@ stub_udp_read_cb(void *userarg)
|
|||
#endif
|
||||
while (GLDNS_TC_WIRE(netreq->response)) {
|
||||
DEBUG_STUB("%s %-35s: MSG: %p TC bit set in response \n", STUB_DEBUG_READ,
|
||||
__FUNCTION__, netreq);
|
||||
__FUNCTION__, (void*)netreq);
|
||||
if (!(netreq->transport_current < netreq->transport_count))
|
||||
break;
|
||||
getdns_transport_list_t next_transport =
|
||||
|
@ -1372,7 +1372,7 @@ stub_udp_write_cb(void *userarg)
|
|||
getdns_dns_req *dnsreq = netreq->owner;
|
||||
size_t pkt_len;
|
||||
DEBUG_STUB("%s %-35s: MSG: %p \n", STUB_DEBUG_WRITE,
|
||||
__FUNCTION__, netreq);
|
||||
__FUNCTION__, (void*)netreq);
|
||||
|
||||
GETDNS_CLEAR_EVENT(dnsreq->loop, &netreq->event);
|
||||
|
||||
|
@ -1479,7 +1479,7 @@ upstream_read_cb(void *userarg)
|
|||
}
|
||||
|
||||
DEBUG_STUB("%s %-35s: MSG: %p (read)\n",
|
||||
STUB_DEBUG_READ, __FUNCTION__, netreq);
|
||||
STUB_DEBUG_READ, __FUNCTION__, (void*)netreq);
|
||||
netreq->state = NET_REQ_FINISHED;
|
||||
netreq->response = upstream->tcp.read_buf;
|
||||
netreq->response_len =
|
||||
|
@ -1560,7 +1560,7 @@ upstream_write_cb(void *userarg)
|
|||
|
||||
netreq->debug_start_time = _getdns_get_time_as_uintt64();
|
||||
DEBUG_STUB("%s %-35s: MSG: %p (writing)\n", STUB_DEBUG_WRITE,
|
||||
__FUNCTION__, netreq);
|
||||
__FUNCTION__, (void*)netreq);
|
||||
|
||||
/* Health checks on current connection */
|
||||
if (upstream->conn_state == GETDNS_CONN_TEARDOWN)
|
||||
|
@ -1585,7 +1585,7 @@ upstream_write_cb(void *userarg)
|
|||
case STUB_SETUP_ERROR:
|
||||
/* Could not complete the set up. Need to fallback.*/
|
||||
DEBUG_STUB("%s %-35s: Upstream: %p ERROR = %d\n", STUB_DEBUG_WRITE,
|
||||
__FUNCTION__, ((getdns_network_req *)userarg), q);
|
||||
__FUNCTION__, (void*)userarg, q);
|
||||
upstream_failed(upstream, (q == STUB_TCP_ERROR ? 0:1));
|
||||
/* Fall through */
|
||||
case STUB_CONN_GONE:
|
||||
|
@ -1800,7 +1800,7 @@ upstream_connect(getdns_upstream *upstream, getdns_transport_list_t transport,
|
|||
getdns_dns_req *dnsreq)
|
||||
{
|
||||
DEBUG_STUB("%s %-35s: Getting upstream connection: %p\n", STUB_DEBUG_SETUP,
|
||||
__FUNCTION__, upstream);
|
||||
__FUNCTION__, (void*)upstream);
|
||||
int fd = -1;
|
||||
switch(transport) {
|
||||
case GETDNS_TRANSPORT_UDP:
|
||||
|
@ -1874,7 +1874,7 @@ upstream_find_for_transport(getdns_network_req *netreq,
|
|||
*fd = upstream_connect(upstream, transport, netreq->owner);
|
||||
} while (*fd == -1);
|
||||
DEBUG_STUB("%s %-35s: FD: %d Connecting to upstream: %p No: %d\n",
|
||||
STUB_DEBUG_SETUP, __FUNCTION__, *fd, upstream,
|
||||
STUB_DEBUG_SETUP, __FUNCTION__, *fd, (void*)upstream,
|
||||
(int)(upstream - netreq->owner->context->upstreams->upstreams));
|
||||
}
|
||||
return upstream;
|
||||
|
@ -1898,7 +1898,7 @@ upstream_find_for_netreq(getdns_network_req *netreq)
|
|||
return fd;
|
||||
}
|
||||
/* Handle better, will give generic error*/
|
||||
DEBUG_STUB("%s %-35s: MSG: %p No valid upstream! \n", STUB_DEBUG_SCHEDULE, __FUNCTION__, netreq);
|
||||
DEBUG_STUB("%s %-35s: MSG: %p No valid upstream! \n", STUB_DEBUG_SCHEDULE, __FUNCTION__, (void*)netreq);
|
||||
#if defined(DAEMON_DEBUG) && DAEMON_DEBUG
|
||||
DEBUG_DAEMON("%s *FAILURE* no valid transports or upstreams available!\n",
|
||||
STUB_DEBUG_DAEMON);
|
||||
|
@ -1915,7 +1915,7 @@ fallback_on_write(getdns_network_req *netreq)
|
|||
{
|
||||
|
||||
/* Deal with UDP one day*/
|
||||
DEBUG_STUB("%s %-35s: MSG: %p FALLING BACK \n", STUB_DEBUG_SCHEDULE, __FUNCTION__, netreq);
|
||||
DEBUG_STUB("%s %-35s: MSG: %p FALLING BACK \n", STUB_DEBUG_SCHEDULE, __FUNCTION__, (void*)netreq);
|
||||
|
||||
/* Try to find a fallback transport*/
|
||||
getdns_return_t result = _getdns_submit_stub_request(netreq);
|
||||
|
@ -1963,7 +1963,7 @@ upstream_reschedule_events(getdns_upstream *upstream, uint64_t idle_timeout) {
|
|||
static void
|
||||
upstream_schedule_netreq(getdns_upstream *upstream, getdns_network_req *netreq)
|
||||
{
|
||||
DEBUG_STUB("%s %-35s: MSG: %p (schedule event)\n", STUB_DEBUG_SCHEDULE, __FUNCTION__, netreq);
|
||||
DEBUG_STUB("%s %-35s: MSG: %p (schedule event)\n", STUB_DEBUG_SCHEDULE, __FUNCTION__, (void*)netreq);
|
||||
/* We have a connected socket and a global event loop */
|
||||
assert(upstream->fd >= 0);
|
||||
assert(upstream->loop);
|
||||
|
@ -2015,7 +2015,7 @@ getdns_return_t
|
|||
_getdns_submit_stub_request(getdns_network_req *netreq)
|
||||
{
|
||||
DEBUG_STUB("%s %-35s: MSG: %p TYPE: %d\n", STUB_DEBUG_ENTRY, __FUNCTION__,
|
||||
netreq, netreq->request_type);
|
||||
(void*)netreq, netreq->request_type);
|
||||
int fd = -1;
|
||||
getdns_dns_req *dnsreq = netreq->owner;
|
||||
|
||||
|
|
Loading…
Reference in New Issue