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