summaryrefslogtreecommitdiffstats
path: root/sockets.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-11 15:44:58 +0000
committerdscho <dscho>2001-10-11 15:44:58 +0000
commit67094d7c281993497decb1459ea1663765a760eb (patch)
tree6317d81c1ddca58b5e3b8e1556ae9b904e0d160b /sockets.c
parent519a8e0e399bf44893f2d61a3676f3257ab8d201 (diff)
downloadlibtdevnc-67094d7c281993497decb1459ea1663765a760eb.tar.gz
libtdevnc-67094d7c281993497decb1459ea1663765a760eb.zip
replaced xalloc with malloc functions, udp input support (untested), fixed http
Diffstat (limited to 'sockets.c')
-rw-r--r--sockets.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sockets.c b/sockets.c
index 776fc49..7134468 100644
--- a/sockets.c
+++ b/sockets.c
@@ -214,15 +214,14 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
}
if ((rfbScreen->udpSock != -1) && FD_ISSET(rfbScreen->udpSock, &fds)) {
-
+ if(!rfbScreen->udpClient)
+ rfbNewUDPClient(rfbScreen);
if (recvfrom(rfbScreen->udpSock, buf, 1, MSG_PEEK,
(struct sockaddr *)&addr, &addrlen) < 0) {
-
rfbLogPerror("rfbCheckFds: UDP: recvfrom");
rfbDisconnectUDPSock(rfbScreen);
-
+ rfbScreen->udpSockConnected = FALSE;
} else {
-
if (!rfbScreen->udpSockConnected ||
(memcmp(&addr, &rfbScreen->udpRemoteAddr, addrlen) != 0))
{
@@ -242,8 +241,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
rfbNewUDPConnection(rfbScreen,rfbScreen->udpSock);
}
- /* TODO: UDP also needs a client
- rfbProcessUDPInput(rfbScreen,rfbScreen->udpSock); */
+ rfbProcessUDPInput(rfbScreen);
}
FD_CLR(rfbScreen->udpSock, &fds);
@@ -263,7 +261,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
void
rfbDisconnectUDPSock(rfbScreenInfoPtr rfbScreen)
{
- rfbScreen->udpSockConnected = FALSE;
+ rfbScreen->udpSockConnected = FALSE;
}