diff options
author | dscho <dscho> | 2002-08-31 14:13:50 +0000 |
---|---|---|
committer | dscho <dscho> | 2002-08-31 14:13:50 +0000 |
commit | b34beb1b22a53046fd09f872e6541aea8e166f7f (patch) | |
tree | e2a72721ab48b735f8ae1d3bb8684dd991af3d4b | |
parent | 0024d7472768635915ee6cc511fc258c121b9b9c (diff) | |
download | libtdevnc-b34beb1b22a53046fd09f872e6541aea8e166f7f.tar.gz libtdevnc-b34beb1b22a53046fd09f872e6541aea8e166f7f.zip |
socket via proxy gets options set, compiler warning fixes
-rw-r--r-- | cvs_update_anonymously | 9 | ||||
-rw-r--r-- | httpd.c | 4 | ||||
-rw-r--r-- | rfbserver.c | 19 | ||||
-rw-r--r-- | vncauth.c | 2 |
4 files changed, 30 insertions, 4 deletions
diff --git a/cvs_update_anonymously b/cvs_update_anonymously index f94b616..26f2014 100644 --- a/cvs_update_anonymously +++ b/cvs_update_anonymously @@ -1 +1,8 @@ -cvs -z3 -d :pserver:anonymous@cvs.libvncserver.sf.net:/cvsroot/libvncserver update +if [ a"$1" = adiff ]; then + cmd=diff +else + cmd=update +fi + +cvs -z3 -d :pserver:anonymous@cvs.libvncserver.sf.net:/cvsroot/libvncserver $cmd + @@ -270,7 +270,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen) // proxy connection rfbLog("httpd: client asked for CONNECT\n"); WriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR)); - rfbNewClient(rfbScreen,rfbScreen->httpSock); + rfbNewClientConnection(rfbScreen,rfbScreen->httpSock); // don't fclose(rfbScreen->httpFP), because this would kill the connection rfbScreen->httpFP = NULL; rfbScreen->httpSock = -1; @@ -280,7 +280,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen) // proxy connection rfbLog("httpd: client asked for /proxied.connection\n"); WriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR)); - rfbNewClient(rfbScreen,rfbScreen->httpSock); + rfbNewClientConnection(rfbScreen,rfbScreen->httpSock); // don't fclose(rfbScreen->httpFP), because this would kill the connection rfbScreen->httpFP = NULL; rfbScreen->httpSock = -1; diff --git a/rfbserver.c b/rfbserver.c index bfc2e91..7ba360e 100644 --- a/rfbserver.c +++ b/rfbserver.c @@ -35,8 +35,10 @@ #include <pwd.h> #include <sys/socket.h> #include <netinet/in.h> +#include <netinet/tcp.h> #include <arpa/inet.h> #endif +#include <fcntl.h> #include <sys/types.h> #ifdef CORBA @@ -213,6 +215,8 @@ rfbNewTCPOrUDPClient(rfbScreen,sock,isUDP) if(isUDP) { rfbLog(" accepted UDP client\n"); } else { + int one=1; + getpeername(sock, (struct sockaddr *)&addr, &addrlen); cl->host = strdup(inet_ntoa(addr.sin_addr)); @@ -223,6 +227,21 @@ rfbNewTCPOrUDPClient(rfbScreen,sock,isUDP) } rfbReleaseClientIterator(iterator); +#ifndef WIN32 + if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) { + rfbLogPerror("fcntl failed"); + close(sock); + return NULL; + } +#endif + + if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, + (char *)&one, sizeof(one)) < 0) { + rfbLogPerror("setsockopt failed"); + close(sock); + return NULL; + } + FD_SET(sock,&(rfbScreen->allFds)); rfbScreen->maxFd = max(sock,rfbScreen->maxFd); @@ -63,7 +63,7 @@ vncEncryptAndStorePasswd(char *passwd, char *fname) /* windows security sux */ #ifndef WIN32 - fchmod(fp, S_IRUSR|S_IWUSR); + fchmod(fileno(fp), S_IRUSR|S_IWUSR); #endif /* pad password with nulls */ |