myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_1-49-g


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_1-49-g04bbfaf
Date: Wed, 10 Feb 2010 10:14:35 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  04bbfafe6dc25628398e64090d1f194acd2ce772 (commit)
       via  5c7466a43cd7f9acb596ee847516b352a56e0100 (commit)
       via  f1818a6b9fdbd109d417c742f5c21fe9485fe4a0 (commit)
       via  5362bb29ea99952336f047b443cb1a15e9c677f4 (commit)
       via  8572121133a4437d8ae1fc1d095dfeb5f2e83ea1 (commit)
       via  8f32cabfed5a7156f75afd2796ad585b59af1832 (commit)
      from  43a210fc80d47a4dd91d60963851009af14ce686 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit 04bbfafe6dc25628398e64090d1f194acd2ce772
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 11:01:23 2010 +0100

    Avoid a double cast when checking the error status

diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index 53a62ee..83c645c 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -91,14 +91,19 @@ File::~File ()
  */
 int File::writeToFile (const char* buffer, u_long buffersize, u_long* nbw)
 {
+  int ret;
   if (buffersize == 0)
   {
     *nbw = 0;
-    return 1;
+    return -1;
   }
 
-  *nbw = ::write (handle, buffer, buffersize);
-  return (*nbw == buffersize) ? 0 : 1 ;
+  ret = ::write (handle, buffer, buffersize);
+  if (ret < 0)
+    return ret;
+
+  *nbw = static_cast<u_long> (ret);
+  return 0;
 }
 
 /*!
@@ -322,7 +327,7 @@ int File::write (const char* buffer, u_long len, u_long 
*nbw)
 
 /*!
  *Read data from a file to a buffer.
- *Return 1 on errors.
+ *Return a negative value on errors.
  *Return 0 on success.
  *\param buffer The buffer where write.
  *\param buffersize The length of the buffer in bytes.
@@ -331,8 +336,11 @@ int File::write (const char* buffer, u_long len, u_long 
*nbw)
 int File::read (char* buffer, u_long buffersize, u_long* nbr)
 {
   int ret  = ::read (handle, buffer, buffersize);
-  *nbr = (u_long) ret;
-  return (ret == -1);
+  if (ret < 0)
+    return ret;
+
+  *nbr = static_cast<u_long> (ret);
+  return 0;
 }
 
 /*!
@@ -374,25 +382,25 @@ int File::fastCopyToSocket (Socket *dest, u_long 
firstByte, MemBuf *buf, u_long
   char *buffer = buf->getBuffer ();
   u_long size = buf->getRealLength ();
 
-       if (seek (firstByte))
+  if (seek (firstByte))
     return 0;
 
   for (;;)
-  {
-    u_long nbr;
-    u_long tmpNbw;
+    {
+      u_long nbr;
+      u_long tmpNbw;
 
-    if (read (buffer, size, &nbr))
-      return -1;
+      if (read (buffer, size, &nbr))
+        return -1;
 
-    if (nbr == 0)
-      break;
+      if (nbr == 0)
+        break;
 
-    if (dest->write (buffer, nbr, &tmpNbw))
-      return -1;
+      if (dest->write (buffer, nbr, &tmpNbw))
+        return -1;
 
-    *nbw += tmpNbw;
-  }
+      *nbw += tmpNbw;
+    }
 
   return 0;
 #endif
diff --git a/myserver/src/base/socket/socket.cpp 
b/myserver/src/base/socket/socket.cpp
index 7ed0021..63257cd 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -673,26 +673,28 @@ int Socket::dataOnRead (int sec, int usec)
 
 /*!
  *Inherited from Stream.
- *Return zero on success, or -1 error. Also sets nbr to -1 if error.
+ *Return zero on success, or a negative number on error.
  */
 int Socket::read (char* buffer, u_long len, u_long *nbr)
 {
-  *nbr = static_cast<u_long>(recv (buffer, len, 0));
-  if (*nbr == static_cast<u_long>(-1))
-    return -1;
+  int ret = recv (buffer, len, 0);
+  if (ret < 0)
+    return ret;
 
+  *nbr = static_cast<u_long> (ret);
   return 0;
 }
 
 /*!
  *Inherited from Stream.
- *Return zero on success, or -1 on error. Also sets nbw to -1 if error.
+ *Return zero on success, or a negative number on error.
  */
 int Socket::write (const char* buffer, u_long len, u_long *nbw)
 {
-  *nbw = static_cast<u_long>(send (buffer, len, 0));
-  if ( *nbw == static_cast<u_long>(-1) )
-    return -1;
+  int ret = send (buffer, len, 0);
+  if (ret < 0)
+    return ret;
 
+  *nbw = static_cast<u_long> (ret);
   return 0;
 }
diff --git a/myserver/src/base/unix_socket/unix_socket.cpp 
b/myserver/src/base/unix_socket/unix_socket.cpp
index b24463a..e16eec5 100644
--- a/myserver/src/base/unix_socket/unix_socket.cpp
+++ b/myserver/src/base/unix_socket/unix_socket.cpp
@@ -1,18 +1,18 @@
 /*
-MyServer
-Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  MyServer
+  Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 
@@ -31,9 +31,9 @@ UnixSocket::~UnixSocket ()
 }
 
 /*!
- *Bind the socket to a file.  If the file exists it is removed.
- *\param path Path to the file bound by the socket.
- *\return 0 on success.
+ * Bind the socket to a file.  If the file exists it is removed.
+ * \param path Path to the file bound by the socket.
+ * \return 0 on success.
  */
 int UnixSocket::bind (const char* path)
 {
@@ -44,15 +44,15 @@ int UnixSocket::bind (const char* path)
   makeAddrInfo (&addr, path);
   unlink (path);
 
-  return Socket::bind ((MYSERVER_SOCKADDR*)&addr, sizeof (sockaddr_un));
+  return Socket::bind ((MYSERVER_SOCKADDR*) &addr, sizeof (sockaddr_un));
 #else
   return -1;
 #endif
 }
 
 /*!
- *Shutdown the socket.
- *\return 0 on success.
+ * Shutdown the socket.
+ * \return 0 on success.
  */
 int UnixSocket::shutdown ()
 {
@@ -66,8 +66,8 @@ int UnixSocket::shutdown ()
 
 
 /*!
- *Free the socket.
- *\return 0 on success.
+ * Free the socket.
+ * \return 0 on success.
  */
 int UnixSocket::close ()
 {
@@ -79,8 +79,8 @@ int UnixSocket::close ()
 }
 
 /*!
- *Open the socket.
- *\return the socket handle on success.
+ * Open the socket.
+ * \return the socket handle on success.
  */
 int UnixSocket::socket ()
 {
@@ -92,9 +92,9 @@ int UnixSocket::socket ()
 }
 
 /*!
- *Connect to an Unix socket by its path.
- *\param path Path to the Unix socket.
- *\return 0 on success.
+ * Connect to an Unix socket by its path.
+ * \param path Path to the Unix socket.
+ * \return 0 on success.
  */
 int UnixSocket::connect (const char* path)
 {
@@ -104,32 +104,30 @@ int UnixSocket::connect (const char* path)
 #ifdef AF_UNIX
   makeAddrInfo (&addr, path);
 
-  return Socket::connect ((MYSERVER_SOCKADDR*)&addr, sizeof (addr));
+  return Socket::connect ((MYSERVER_SOCKADDR*) &addr, sizeof (addr));
 #else
   return -1;
 #endif
 }
 
 /*!
- *Accept a new connection.
+ * Accept a new connection.
  */
 Socket* UnixSocket::accept ()
 {
-
 #ifdef AF_UNIX
   sockaddr_un addr;
   socklen_t len = sizeof (addr);
-  return Socket::accept ((MYSERVER_SOCKADDR*)&addr, &len);
+  return Socket::accept ((MYSERVER_SOCKADDR*) &addr, &len);
 #else
-  return new Socket ((SocketHandle)-1);
+  return new Socket (-1);
 #endif
 }
 
-
 /*!
- *Read a file handle on the socket pair.
- *\param fd The file descriptor to read.
- *\return 0 on success.
+ * Read a file handle on the socket pair.
+ * \param fd The file descriptor to read.
+ * \return 0 on success.
  */
 int UnixSocket::readHandle (Handle* fd)
 {
@@ -137,9 +135,9 @@ int UnixSocket::readHandle (Handle* fd)
 }
 
 /*!
- *Transmit a file descriptor on the socket.
- *\param fd The file descriptor to transmit.
- *\return 0 on success.
+ * Transmit a file descriptor on the socket.
+ * \param fd The file descriptor to transmit.
+ * \return 0 on success.
  */
 int UnixSocket::writeHandle (Handle fd)
 {



commit 5c7466a43cd7f9acb596ee847516b352a56e0100
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 10:40:11 2010 +0100

    Fix a name conflict.

diff --git a/myserver/src/base/unix_socket/unix_socket.cpp 
b/myserver/src/base/unix_socket/unix_socket.cpp
index fdfabb9..b24463a 100644
--- a/myserver/src/base/unix_socket/unix_socket.cpp
+++ b/myserver/src/base/unix_socket/unix_socket.cpp
@@ -133,7 +133,7 @@ Socket* UnixSocket::accept ()
  */
 int UnixSocket::readHandle (Handle* fd)
 {
-  return readFileHandle (fd, fd);
+  return readFileHandle (this->fd, fd);
 }
 
 /*!



commit f1818a6b9fdbd109d417c742f5c21fe9485fe4a0
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 10:25:26 2010 +0100

    Rename file

diff --git a/misc/wingen/NSIS installer script.nsi 
b/misc/wingen/nsis_installer_script.nsi
similarity index 100%
rename from misc/wingen/NSIS installer script.nsi
rename to misc/wingen/nsis_installer_script.nsi



commit 5362bb29ea99952336f047b443cb1a15e9c677f4
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 10:24:06 2010 +0100

    Remove unused files.

diff --git a/misc/Sudoku.Core/INSTALL b/misc/Sudoku.Core/INSTALL
deleted file mode 120000
index cbd1c80..0000000
--- a/misc/Sudoku.Core/INSTALL
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/automake-1.11/INSTALL
\ No newline at end of file
diff --git a/misc/control/MyServer Configure.dev b/misc/control/MyServer 
Configure.dev
deleted file mode 100644
index 1a82f5b..0000000
--- a/misc/control/MyServer Configure.dev       
+++ /dev/null
@@ -1,189 +0,0 @@
-[Project]
-FileName=MyServer Configure.dev
-Name=MyServer Configure
-UnitCount=9
-Type=0
-Ver=1
-ObjFiles=
-Includes=..;.
-Libs=
-PrivateResource=MyServer_Configure_private.rc
-ResourceIncludes=
-MakeIncludes=
-Compiler=-DWIN32_@@_
-CppCompiler=
-Linker=../src/securestr.o ../src/utility.o  ../src/safetime.o   
../src/thread.o  ../src/file.o ../src/ssl_socket.o   ../src/stringutils.o 
../src/socket.o ../src/stream.o ../src/find_data.o ../src/xml_parser.o  
../src/mem_buff.o ../src/md5.o   ../src/files_utility.o -lfltk -lm -lz.dll 
-llibxml2 -liconv -lintl -lssl  -lcrypto -lwininet -lwsock32  -lole32  -luuid  
_@@_
-IsCpp=1
-Icon=MyServer Configure.ico
-ExeOutput=..\binaries
-ObjectOutput=tmp
-OverrideOutput=0
-OverrideOutputName=myserver-configure.exe
-HostApplication=
-Folders=
-CommandLine=
-UseCustomMakefile=0
-CustomMakefile=
-IncludeVersionInfo=1
-SupportXPThemes=0
-CompilerSet=0
-CompilerSettings=0000000001000000000100
-
-[VersionInfo]
-Major=0
-Minor=9
-Release=0
-Build=3
-LanguageID=1033
-CharsetID=1252
-CompanyName=MyServer Project
-FileVersion=0.9.0
-FileDescription=MyServer Configuration Interface
-InternalName=
-LegalCopyright=MyServer Team
-LegalTrademarks=
-OriginalFilename=MyServer Configure.exe
-ProductName=MyServer
-ProductVersion=0.9.0
-AutoIncBuildNr=0
-
-[Unit2]
-FileName=language.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit5]
-FileName=service.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit9]
-FileName=progress.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit11]
-FileName=vhost.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit12]
-FileName=vector.h
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit13]
-FileName=vector.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit14]
-FileName=control_client.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit15]
-FileName=progress.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit1]
-FileName=fltkconfig.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit3]
-FileName=myserver-configure.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit4]
-FileName=mimetype.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit6]
-FileName=vhost.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit7]
-FileName=vector.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Unit8]
-FileName=control_client.cpp
-CompileCpp=1
-Folder=MyServer Configure
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
diff --git a/misc/control/MyServer Configure.ico b/misc/control/MyServer 
Configure.ico
deleted file mode 100644
index d7a0fa1..0000000
Binary files a/misc/control/MyServer Configure.ico and /dev/null differ



commit 8572121133a4437d8ae1fc1d095dfeb5f2e83ea1
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 10:20:42 2010 +0100

    Invoke autoreconf in place of aclocal/autoheader/automake/autoconf

diff --git a/misc/Sudoku.Core/INSTALL b/misc/Sudoku.Core/INSTALL
index 5bb6e7b..cbd1c80 120000
--- a/misc/Sudoku.Core/INSTALL
+++ b/misc/Sudoku.Core/INSTALL
@@ -1 +1 @@
-/usr/share/automake-1.10/INSTALL
\ No newline at end of file
+/usr/share/automake-1.11/INSTALL
\ No newline at end of file
diff --git a/misc/Sudoku.Core/autogen.sh b/misc/Sudoku.Core/autogen.sh
index 3c9e3f1..e033c27 100755
--- a/misc/Sudoku.Core/autogen.sh
+++ b/misc/Sudoku.Core/autogen.sh
@@ -1,69 +1,3 @@
 #! /bin/sh
 
-PROJECT=Sudoku
-FILE=
-CONFIGURE=configure.ac
-
-: ${AUTOCONF=autoconf}
-: ${AUTOHEADER=autoheader}
-: ${AUTOMAKE=automake}
-: ${ACLOCAL=aclocal}
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-ORIGDIR=`pwd`
-cd $srcdir
-TEST_TYPE=-f
-aclocalinclude="-I . $ACLOCAL_FLAGS"
-
-DIE=0
-
-($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have autoconf installed to compile $PROJECT."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
-        DIE=1
-}
-
-($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have automake installed to compile $PROJECT."
-        echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz";
-        echo "(or a newer version if it is available)"
-        DIE=1
-}
-
-if test "$DIE" -eq 1; then
-        exit 1
-fi
-                                                                               
 
-#test $TEST_TYPE $FILE || {
-#        echo "You must run this script in the top-level $PROJECT directory"
-#        exit 1
-#}
-
-if test -z "$*"; then
-        echo "I am going to run ./configure with no arguments - if you wish "
-        echo "to pass any to it, please specify them on the $0 command line."
-fi
-
-case $CC in
-*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
-esac
-
-echo "Running $ACLOCAL $aclocalinclude ..."
-$ACLOCAL $aclocalinclude
-
-echo "Running $AUTOHEADER ..."
-$AUTOHEADER
-
-echo "Running $AUTOMAKE --gnu $am_opt ..."
-$AUTOMAKE --add-missing --gnu $am_opt
-
-echo "Running $AUTOCONF ..."
-$AUTOCONF
-
-echo Running $srcdir/configure $conf_flags "$@" ...
-$srcdir/configure --enable-maintainer-mode $conf_flags "$@" \
+autoreconf -fis



commit 8f32cabfed5a7156f75afd2796ad585b59af1832
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 10:17:45 2010 +0100

    Rename `socketHandle' to `fd'.

diff --git a/myserver/include/base/socket/socket.h 
b/myserver/include/base/socket/socket.h
index 92352b8..c2b757a 100644
--- a/myserver/include/base/socket/socket.h
+++ b/myserver/include/base/socket/socket.h
@@ -110,7 +110,7 @@ public:
   virtual int write (const char* buffer, u_long len, u_long *nbw);
 
 protected:
-  SocketHandle socketHandle;
+  SocketHandle fd;
 
   /*! Pointer to the socket that has accepted this connection.  */
   Socket *serverSocket;
diff --git a/myserver/src/base/socket/socket.cpp 
b/myserver/src/base/socket/socket.cpp
index 661fc84..7ed0021 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -65,7 +65,7 @@ int Socket::startupSocketLib ()
  */
 Handle Socket::getHandle ()
 {
-  return (Handle) socketHandle;
+  return (Handle) fd;
 }
 
 /*!
@@ -73,7 +73,7 @@ Handle Socket::getHandle ()
  */
 void Socket::setHandle (SocketHandle h)
 {
-  socketHandle = h;
+  fd = h;
 }
 
 /*!
@@ -81,7 +81,7 @@ void Socket::setHandle (SocketHandle h)
  */
 int Socket::operator==(Socket* s)
 {
-  return socketHandle == s->socketHandle;
+  return fd == s->fd;
 }
 
 /*!
@@ -89,7 +89,7 @@ int Socket::operator==(Socket* s)
  */
 int Socket::operator=(Socket* s)
 {
-  socketHandle = s->socketHandle;
+  fd = s->fd;
   serverSocket = s->serverSocket;
   throttlingRate = s->throttlingRate;
   isNonBlocking = s->isNonBlocking;
@@ -100,8 +100,8 @@ int Socket::operator=(Socket* s)
  */
 int Socket::socket (int af, int type, int protocol)
 {
-  socketHandle = ::socket (af, type, protocol);
-  return socketHandle;
+  fd = ::socket (af, type, protocol);
+  return fd;
 }
 
 /*!
@@ -119,7 +119,7 @@ Socket::Socket (SocketHandle handle)
  */
 Socket::Socket (Socket* socket)
 {
-  socketHandle = socket->socketHandle;
+  fd = socket->fd;
   serverSocket = socket->serverSocket;
   throttlingRate = socket->throttlingRate;
   isNonBlocking = socket->isNonBlocking;
@@ -174,7 +174,7 @@ int Socket::bind (MYSERVER_SOCKADDR* sa, int namelen)
       )
     return -1;
 
-  return ::bind (socketHandle, (struct sockaddr*) sa, namelen);
+  return ::bind (fd, (struct sockaddr*) sa, namelen);
 }
 
 /*!
@@ -182,7 +182,7 @@ int Socket::bind (MYSERVER_SOCKADDR* sa, int namelen)
  */
 int Socket::listen (int max)
 {
-  return ::listen (socketHandle, max);
+  return ::listen (fd, max);
 }
 
 /*!
@@ -190,7 +190,7 @@ int Socket::listen (int max)
  */
 Socket* Socket::accept (MYSERVER_SOCKADDR* sa, socklen_t* sockaddrlen)
 {
-  int acceptedHandle = ::accept (socketHandle, (struct sockaddr *)sa,
+  int acceptedHandle = ::accept (fd, (struct sockaddr *)sa,
                                           sockaddrlen);
 
   if (acceptedHandle >= 0)
@@ -205,10 +205,10 @@ Socket* Socket::accept (MYSERVER_SOCKADDR* sa, socklen_t* 
sockaddrlen)
 int Socket::close ()
 {
   int ret = -1;
-  if (socketHandle >= 0)
-    ret = ::close (socketHandle);
+  if (fd >= 0)
+    ret = ::close (fd);
 
-  socketHandle = -1;
+  fd = -1;
   return ret;
 }
 
@@ -233,7 +233,7 @@ MYSERVER_HOSTENT *Socket::gethostbyname (const char 
*hostname)
  */
 int Socket::shutdown (int how)
 {
-  return ::shutdown (socketHandle, how);
+  return ::shutdown (fd, how);
 }
 
 /*!
@@ -242,7 +242,7 @@ int Socket::shutdown (int how)
 int  Socket::setsockopt (int level, int optname,
                        const char *optval, int optlen)
 {
-  return ::setsockopt (socketHandle, level, optname, optval, optlen);
+  return ::setsockopt (fd, level, optname, optval, optlen);
 }
 
 /*!
@@ -326,7 +326,7 @@ int Socket::getLocalIPsList (string &out)
  */
 int Socket::rawSend (const char* buffer, int len, int flags)
 {
-  return ::send (socketHandle, buffer, len, flags);
+  return ::send (fd, buffer, len, flags);
 }
 
 /*!
@@ -379,7 +379,7 @@ int Socket::send (const char* buffer, int len, int flags)
  */
 int Socket::ioctlsocket (long cmd, unsigned long* argp)
 {
-  return ::ioctl (socketHandle, cmd, argp);
+  return ::ioctl (fd, cmd, argp);
 }
 
 /*!
@@ -493,7 +493,7 @@ int Socket::connect (const char* host, u_short port)
     return -1;
 
   /*! If the socket is not created, create it before use. */
-  if (socketHandle == -1 &&
+  if (fd == -1 &&
       Socket::socket (AF_INET, SOCK_STREAM, 0) == -1)
     return -1;
 
@@ -527,7 +527,7 @@ int Socket::connect (MYSERVER_SOCKADDR* sa, int na)
  )
     return -1;
 
-  return ::connect (socketHandle, (sockaddr *) sa, na);
+  return ::connect (fd, (sockaddr *) sa, na);
 }
 
 /*!
@@ -549,7 +549,7 @@ int Socket::recv (char* buffer,int len,int flags)
 {
   int err = 0;
 
-  err = ::recv (socketHandle, buffer, len, flags);
+  err = ::recv (fd, buffer, len, flags);
 
   if ( err < 0 && errno == EAGAIN && isNonBlocking)
     return 0;
@@ -594,7 +594,7 @@ int Socket::setNonBlocking (int nonBlocking)
   u_long nonblock = nonBlocking ? 1 : 0;
   ret = ioctlsocket (FIONBIO, &nonblock);
 #else
-  flags = fcntl (socketHandle, F_GETFL, 0);
+  flags = fcntl (fd, F_GETFL, 0);
   if (flags < 0)
     return -1;
 
@@ -603,7 +603,7 @@ int Socket::setNonBlocking (int nonBlocking)
   else
     flags &= ~O_NONBLOCK;
 
-  ret = fcntl (socketHandle, F_SETFL, flags);
+  ret = fcntl (fd, F_SETFL, flags);
 
   isNonBlocking = nonBlocking ? true : false;
 #endif
@@ -625,7 +625,7 @@ int Socket::gethostname (char *name, int namelen)
 int Socket::getsockname (MYSERVER_SOCKADDR *ad, int *namelen)
 {
   socklen_t len =(socklen_t) *namelen;
-  int ret = ::getsockname (socketHandle, (struct sockaddr *)ad, &len);
+  int ret = ::getsockname (fd, (struct sockaddr *)ad, &len);
   *namelen = (int)len;
   return ret;
 }
@@ -658,14 +658,14 @@ int Socket::dataOnRead (int sec, int usec)
   tv.tv_usec = usec;
 
   FD_ZERO (&readfds);
-  FD_SET (socketHandle, &readfds);
+  FD_SET (fd, &readfds);
 
-  ret = ::select (socketHandle + 1, &readfds, NULL, NULL, &tv);
+  ret = ::select (fd + 1, &readfds, NULL, NULL, &tv);
 
   if (ret <= 0)
     return 0;
 
-  if (FD_ISSET (socketHandle, &readfds))
+  if (FD_ISSET (fd, &readfds))
     return 1;
 
   return 0;
diff --git a/myserver/src/base/socket/ssl_socket.cpp 
b/myserver/src/base/socket/ssl_socket.cpp
index ca0f017..75f95d8 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -85,7 +85,7 @@ int SslSocket::shutdown (int how)
   if (sslConnection)
     SSL_shutdown (sslConnection);
 
-  return ::shutdown (socketHandle, how);
+  return ::shutdown (fd, how);
 }
 
 /*!
@@ -129,7 +129,7 @@ int SslSocket::connect (MYSERVER_SOCKADDR* sa, int na)
     return -1;
 
   /*! Do the TCP connection.  */
-  if (::connect (socketHandle, (sockaddr *) sa, na))
+  if (::connect (fd, (sockaddr *) sa, na))
     {
       SSL_CTX_free (sslContext);
       sslContext = 0;
@@ -142,7 +142,7 @@ int SslSocket::connect (MYSERVER_SOCKADDR* sa, int na)
       sslContext = 0;
       return -1;
     }
-  SSL_set_fd (sslConnection, socketHandle);
+  SSL_set_fd (sslConnection, fd);
   if (SSL_connect (sslConnection) < 0)
     {
       SSL_CTX_free (sslContext);
@@ -211,7 +211,7 @@ int SslSocket::sslAccept ()
       return -1;
     }
 
-  if (SSL_set_fd (sslConnection, socketHandle) == 0)
+  if (SSL_set_fd (sslConnection, fd) == 0)
     {
       shutdown (2);
       freeSSL ();
diff --git a/myserver/src/base/socket_pair/socket_pair.cpp 
b/myserver/src/base/socket_pair/socket_pair.cpp
index 7ed8f29..d2d3dbb 100644
--- a/myserver/src/base/socket_pair/socket_pair.cpp
+++ b/myserver/src/base/socket_pair/socket_pair.cpp
@@ -63,7 +63,7 @@ int SocketPair::create ()
 #ifndef WIN32
   int ret = socketpair (AF_UNIX, SOCK_STREAM, 0, (int*) handles);
   if (ret == 0)
-    socketHandle = handles[0];
+    fd = handles[0];
 
   return ret;
 #else
@@ -113,7 +113,7 @@ int SocketPair::create ()
       if ((handles[1] = ::accept (listener, NULL, NULL)) < 0)
         break;
 
-      socketHandle = handles[0];
+      fd = handles[0];
 
       ::close (listener);
       return 0;
@@ -162,7 +162,7 @@ void SocketPair::inverted (SocketPair& inverted)
   inverted.handles[0] = handles[1];
   inverted.handles[1] = handles[0];
 
-  inverted.socketHandle = handles[1];
+  inverted.fd = handles[1];
 }
 
 /*!
diff --git a/myserver/src/base/unix_socket/unix_socket.cpp 
b/myserver/src/base/unix_socket/unix_socket.cpp
index 7e11b18..fdfabb9 100644
--- a/myserver/src/base/unix_socket/unix_socket.cpp
+++ b/myserver/src/base/unix_socket/unix_socket.cpp
@@ -133,7 +133,7 @@ Socket* UnixSocket::accept ()
  */
 int UnixSocket::readHandle (Handle* fd)
 {
-  return readFileHandle (socketHandle, fd);
+  return readFileHandle (fd, fd);
 }
 
 /*!
@@ -143,5 +143,5 @@ int UnixSocket::readHandle (Handle* fd)
  */
 int UnixSocket::writeHandle (Handle fd)
 {
-  return writeFileHandle (socketHandle, fd);
+  return writeFileHandle (fd, fd);
 }

-----------------------------------------------------------------------

Summary of changes:
 misc/Sudoku.Core/INSTALL                           |    1 -
 misc/Sudoku.Core/autogen.sh                        |   68 +-------
 misc/control/MyServer Configure.dev                |  189 --------------------
 misc/control/MyServer Configure.ico                |  Bin 2238 -> 0 bytes
 ...taller script.nsi => nsis_installer_script.nsi} |    0
 myserver/include/base/socket/socket.h              |    2 +-
 myserver/src/base/file/file.cpp                    |   44 +++--
 myserver/src/base/socket/socket.cpp                |   70 ++++----
 myserver/src/base/socket/ssl_socket.cpp            |    8 +-
 myserver/src/base/socket_pair/socket_pair.cpp      |    6 +-
 myserver/src/base/unix_socket/unix_socket.cpp      |   80 ++++-----
 11 files changed, 110 insertions(+), 358 deletions(-)
 delete mode 120000 misc/Sudoku.Core/INSTALL
 delete mode 100644 misc/control/MyServer Configure.dev
 delete mode 100644 misc/control/MyServer Configure.ico
 rename misc/wingen/{NSIS installer script.nsi => nsis_installer_script.nsi} 
(100%)


hooks/post-receive
-- 
GNU MyServer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]