diff options
author | dscho <dscho> | 2001-10-11 15:44:58 +0000 |
---|---|---|
committer | dscho <dscho> | 2001-10-11 15:44:58 +0000 |
commit | 67094d7c281993497decb1459ea1663765a760eb (patch) | |
tree | 6317d81c1ddca58b5e3b8e1556ae9b904e0d160b /sockets.c | |
parent | 519a8e0e399bf44893f2d61a3676f3257ab8d201 (diff) | |
download | libtdevnc-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.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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; } |