|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
/* $Id: udp.c,v 1.16 2009/05/12 20:50:34 stpohle Exp $ */
|
|
|
|
|
/* $Id: udp.c,v 1.17 2009/11/28 13:11:51 stpohle Exp $ */
|
|
|
|
|
/* udp.c code for the network
|
|
|
|
|
File Version 0.2
|
|
|
|
|
*/
|
|
|
|
@ -285,12 +285,10 @@ udp_get (int sock, char *text, int len, struct _sockaddr *sAddr, int ai_family)
|
|
|
|
|
FD_SET (sock, &sockset);
|
|
|
|
|
|
|
|
|
|
tval.tv_sec = 0;
|
|
|
|
|
tval.tv_usec = 100;
|
|
|
|
|
|
|
|
|
|
tval.tv_usec = 100;
|
|
|
|
|
msglen = 0;
|
|
|
|
|
|
|
|
|
|
if (select (sock + 1, &sockset, NULL, NULL, &tval)) {
|
|
|
|
|
msglen = recvfrom (sock, text, len, 0, (struct sockaddr *) sAddr, &clen);
|
|
|
|
|
if (select (sock + 1, &sockset, NULL, NULL, &tval)) if (FD_ISSET (sock, &sockset)) {
|
|
|
|
|
msglen = recvfrom (sock, text, len, MSG_DONTWAIT, (struct sockaddr *) sAddr, &clen);
|
|
|
|
|
if (msglen < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
@ -306,12 +304,10 @@ dns_net_getip (char *host)
|
|
|
|
|
{
|
|
|
|
|
struct hostent *hAddr;
|
|
|
|
|
|
|
|
|
|
hAddr = gethostbyname (host);
|
|
|
|
|
|
|
|
|
|
hAddr = gethostbyname (host);
|
|
|
|
|
if (hAddr == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
strncpy (dnsip, inet_ntoa (*((struct in_addr *) hAddr->h_addr)), UDP_LEN_HOSTNAME);
|
|
|
|
|
|
|
|
|
|
return dnsip;
|
|
|
|
|
return dnsip;
|
|
|
|
|
};
|
|
|
|
|