Skip to content

Commit

Permalink
Make the transport server work on Mac OS-X too!
Browse files Browse the repository at this point in the history
  • Loading branch information
wtoorop committed Jan 16, 2015
1 parent e1d3535 commit 90e988c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/test/check_getdns_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,18 @@ void* run_transport_server(void* data) {
if (r > 0) {
ldns_pkt* query;
socklen_t len = sizeof (client_addr);
if (FD_ISSET(udp, &read_fds) == 1) {
if (FD_ISSET(udp, &read_fds)) {
n = recvfrom(udp, mesg, 65536, 0, (struct sockaddr *) &client_addr, &len);
udp_count++;
} else if (FD_ISSET(tcp, &read_fds) == 1) {
} else if (FD_ISSET(tcp, &read_fds)) {
conn = accept(tcp, (struct sockaddr *) &client_addr, &len);
/* throw away the length */
n = read(conn, tcplength, 2);
n = read(conn, mesg, 65536);
tcp_count++;
} else {
fprintf(stderr, "Timeout in run_transport_server\n");
break;
}

ldns_wire2pkt(&query, mesg, n);
Expand Down

0 comments on commit 90e988c

Please sign in to comment.