Enable AF_UNIX socket: ignore setsockopt TCP_NODELAY failure.

pull/1/head
Wen Shuguang 9 years ago
parent 27d0024832
commit dfa5e27579

@ -363,9 +363,7 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
(char *)&one, sizeof(one)) < 0) { (char *)&one, sizeof(one)) < 0) {
rfbLogPerror("setsockopt failed"); rfbLogPerror("setsockopt failed: can't set TCP_NODELAY flag, non TCP socket?");
close(sock);
return NULL;
} }
FD_SET(sock,&(rfbScreen->allFds)); FD_SET(sock,&(rfbScreen->allFds));

@ -146,8 +146,7 @@ rfbInitSockets(rfbScreenInfoPtr rfbScreen)
if (setsockopt(rfbScreen->inetdSock, IPPROTO_TCP, TCP_NODELAY, if (setsockopt(rfbScreen->inetdSock, IPPROTO_TCP, TCP_NODELAY,
(char *)&one, sizeof(one)) < 0) { (char *)&one, sizeof(one)) < 0) {
rfbLogPerror("setsockopt"); rfbLogPerror("setsockopt failed: can't set TCP_NODELAY flag, non TCP socket?");
return;
} }
FD_ZERO(&(rfbScreen->allFds)); FD_ZERO(&(rfbScreen->allFds));
@ -453,9 +452,7 @@ rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen)
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
(char *)&one, sizeof(one)) < 0) { (char *)&one, sizeof(one)) < 0) {
rfbLogPerror("rfbCheckFds: setsockopt"); rfbLogPerror("rfbCheckFds: setsockopt failed: can't set TCP_NODELAY flag, non TCP socket?");
closesocket(sock);
return FALSE;
} }
#ifdef USE_LIBWRAP #ifdef USE_LIBWRAP
@ -556,9 +553,7 @@ rfbConnect(rfbScreenInfoPtr rfbScreen,
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
(char *)&one, sizeof(one)) < 0) { (char *)&one, sizeof(one)) < 0) {
rfbLogPerror("setsockopt failed"); rfbLogPerror("setsockopt failed: can't set TCP_NODELAY flag, non TCP socket?");
closesocket(sock);
return -1;
} }
/* AddEnabledDevice(sock); */ /* AddEnabledDevice(sock); */

Loading…
Cancel
Save