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_2-112-


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_2-112-g7f7be6b
Date: Thu, 08 Apr 2010 16:01:05 +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  7f7be6bb28a2f9f123d85601f9debb7101eaaa43 (commit)
       via  a0f649bb5861d3dd1bf05a888bbcd9f911a52d29 (commit)
       via  06307ce6567dd2068de625af4f3c003fa564345d (commit)
       via  7f8a33e420343c5b5bcd9afc95c28d6471ab621e (commit)
       via  b174a314e45e54354e357e030f21fc852edcdfbc (commit)
      from  219c71afaa76c282119e79a7b2c4cedc641268bd (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 7f7be6bb28a2f9f123d85601f9debb7101eaaa43
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Apr 8 17:51:58 2010 +0200

    Fix build errors under mingw32

diff --git a/myserver/configure.ac b/myserver/configure.ac
index 7b0e2cd..e38be49 100644
--- a/myserver/configure.ac
+++ b/myserver/configure.ac
@@ -52,7 +52,7 @@ AC_C_BIGENDIAN
 LT_INIT
 
 AC_DEFINE([WINVER], [0x0501], [WINVER])
-
+AC_DEFINE([DEPENDS_ON_LIBINTL], [1], [DEPENDS_ON_LIBINTL])
 AC_DEFINE([GNULIB_NAMESPACE], [gnulib], [GNULIB_NAMESPACE])
 
 LT_INIT
diff --git a/myserver/myserver.h b/myserver/myserver.h
index 23dd447..5e1dbed 100644
--- a/myserver/myserver.h
+++ b/myserver/myserver.h
@@ -25,7 +25,6 @@
 #  include <pthread.h>
 # endif
 
-
 # include <stdlib.h>
 # include <stdio.h>
 # include <fcntl.h>
@@ -54,4 +53,3 @@ typedef void* HANDLE;
 #else
 # define _(X) X
 #endif
-
diff --git a/myserver/src/base/base64/mime_utils.cpp 
b/myserver/src/base/base64/mime_utils.cpp
index bc095a3..3348ee9 100644
--- a/myserver/src/base/base64/mime_utils.cpp
+++ b/myserver/src/base/base64/mime_utils.cpp
@@ -26,7 +26,6 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <stdio.h>
 #include <stdlib.h>
 
-
 #include <string.h>
 
 #include <include/base/string/stringutils.h>
@@ -44,7 +43,6 @@ static char* myserver_strupr (char * s)
 
 static char* strustr (char *source, char *s)
 {
-
   char *csource = new char[strlen (source) + 1];
   if (csource == 0)
     return 0;
@@ -449,8 +447,6 @@ char* CQPUtils::decode (char *input)
 
 #define BufAdd 10
 
-
-
 char* CQPUtils::expandBuffer (char *buffer, int UsedSize, int *BufSize,
                              int Singlechar)
 {
@@ -493,7 +489,7 @@ char* CQPUtils::encode (char *input)
       }
       finalresult = expandBuffer (finalresult, UsedSize, &BufSize, 0);
 
-      gnulib::snprintf (mids, 3, "%X", mid);
+      snprintf (mids, 3, "%X", mid);
 
       myserver_strupr (mids);
       *(fresult++) = '=';
diff --git a/myserver/src/base/crypt/crypt_algo_manager.cpp 
b/myserver/src/base/crypt/crypt_algo_manager.cpp
index 3ee5759..1c561ab 100644
--- a/myserver/src/base/crypt/crypt_algo_manager.cpp
+++ b/myserver/src/base/crypt/crypt_algo_manager.cpp
@@ -106,8 +106,7 @@ CryptAlgoManager::check (const char *value, size_t 
valueLen, const char *result,
   CryptAlgo *f = make (algo);
   if (!f)
     {
-      gnulib::snprintf (buffer, bufferLen, _("%s is not a registered 
algorithm"),
-                algo);
+      snprintf (buffer, bufferLen, _("%s is not a registered algorithm"), 
algo);
       throw CryptAlgoManagerException (buffer);
     }
   auto_ptr<CryptAlgo> keeper (f);
diff --git a/myserver/src/base/pipe/pipe.cpp b/myserver/src/base/pipe/pipe.cpp
index d0a614e..d067ce0 100644
--- a/myserver/src/base/pipe/pipe.cpp
+++ b/myserver/src/base/pipe/pipe.cpp
@@ -73,7 +73,7 @@ int Pipe::read (char* buffer, u_long len, u_long *nbr)
  */
 int Pipe::create (bool readPipe)
 {
-  return pipe (handles);
+  return gnulib::pipe2 (handles, 0);
 }
 
 /*!
diff --git a/myserver/src/base/socket/socket.cpp 
b/myserver/src/base/socket/socket.cpp
index f2bab81..738c1b7 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -409,7 +409,7 @@ int Socket::connect (const char* host, u_short port)
     }
 
   memset (szPort, 0, sizeof (char)*10);
-  gnulib::snprintf (szPort, 10, "%d", port);
+  snprintf (szPort, 10, "%d", port);
 
   if (aiHints.ai_family != 0)
     nGetaddrinfoRet = getaddrinfo (host, NULL, &aiHints, &pHostInfo);
diff --git a/myserver/src/base/socket_pair/socket_pair.cpp 
b/myserver/src/base/socket_pair/socket_pair.cpp
index e3bcf2f..868b527 100644
--- a/myserver/src/base/socket_pair/socket_pair.cpp
+++ b/myserver/src/base/socket_pair/socket_pair.cpp
@@ -75,7 +75,7 @@ int SocketPair::create ()
     return -1;
 
   handles[0] = handles[1] = -1;
-  listener = ::socket (AF_INET, SOCK_STREAM, 0);
+  listener = gnulib::socket (AF_INET, SOCK_STREAM, 0);
 
   if (listener < 0)
     return -1;
@@ -85,46 +85,47 @@ int SocketPair::create ()
   addr.sin_addr.s_addr = htonl (0x7f000001);
   addr.sin_port = 0;
 
-  if (::bind (listener, (struct sockaddr*) &addr, sizeof (addr)) < 0)
+  if (gnulib::bind (listener, (struct sockaddr*) &addr, sizeof (addr)) < 0)
     {
-      ::close (listener);
+      gnulib::close (listener);
       return -1;
     }
 
-  if (::getsockname (listener, (struct sockaddr*) &addr, &addrlen) < 0)
+  if (gnulib::getsockname (listener, (struct sockaddr*) &addr, &addrlen) < 0)
     {
-      ::close (listener);
+      gnulib::close (listener);
       return -1;
     }
 
   do
     {
-      if (::listen (listener, 1) < 0)
+      if (gnulib::listen (listener, 1) < 0)
         break;
 
-      if ((handles[0] = ::socket (AF_INET, SOCK_STREAM, 0)) < 0)
+      if ((handles[0] = gnulib::socket (AF_INET, SOCK_STREAM, 0)) < 0)
         break;
 
-      if (::connect (handles[0], (struct sockaddr*) &addr, sizeof (addr)) < 0)
+      if (gnulib::connect (handles[0], (struct sockaddr*) &addr,
+                           sizeof (addr)) < 0)
         break;
 
-      if ((handles[1] = ::accept (listener, NULL, NULL)) < 0)
+      if ((handles[1] = gnulib::accept (listener, NULL, NULL)) < 0)
         break;
 
       fd = handles[0];
 
-      ::close (listener);
+      gnulib::close (listener);
       return 0;
     } while (0);
 
-  ::close (listener);
+  gnulib::close (listener);
 
   if (handles[0] != -1)
-    ::close (handles[0]);
+    gnulib::close (handles[0]);
 
 
   if (handles[1] != -1)
-    ::close (handles[1]);
+    gnulib::close (handles[1]);
 
   return -1;
 #endif
diff --git a/myserver/src/protocol/control/control_protocol.cpp 
b/myserver/src/protocol/control/control_protocol.cpp
index a6cc066..957fd34 100644
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -541,7 +541,7 @@ int ControlProtocol::addToLog (int retCode, ConnectionPtr 
con, char *buffer,
 {
   string time;
   getRFC822GMTTime (time, 32);
-  gnulib::snprintf (buffer, bufferSize, "%s [%s] %s:%s:%s - %s - %i", 
con->getIpAddr (),
+  snprintf (buffer, bufferSize, "%s [%s] %s:%s:%s - %s - %i", con->getIpAddr 
(),
             time.c_str (), header.getCommand (), header.getVersion (),
             header.getOptions (), header.getAuthLogin (), retCode);
   con->host->accessesLogWrite ("%s", buffer);
@@ -565,14 +565,14 @@ int ControlProtocol::sendResponse (char *buffer, int 
buffersize,
     dataLength = outFile->getFileSize ();
 
   /* Build and send the first line.  */
-  gnulib::snprintf (buffer, buffersize, "/%i\r\n", errID);
+  snprintf (buffer, buffersize, "/%i\r\n", errID);
   if (a->socket->send (buffer, strlen (buffer), 0) < 0)
     {
       a->host->warningsLogWrite (_("Control: socket error"));
       return -1;
     }
 
-  gnulib::snprintf (buffer, buffersize, "/LEN %u\r\n", (u_int)dataLength);
+  snprintf (buffer, buffersize, "/LEN %u\r\n", (u_int)dataLength);
   if (a->socket->send (buffer, strlen (buffer), 0) < 0)
     {
       a->host->warningsLogWrite (_("Control: socket error"));
@@ -669,11 +669,11 @@ int ControlProtocol::visitConnection (ConnectionPtr con, 
void *argP)
 
   if (arg->command == ControlProtocolVisitorArg::SHOW_CONNECTIONS)
   {
-    gnulib::snprintf (arg->buffer, arg->bufferSize, "%i - %s - %i - %s - %i - 
%s - %s\r\n",
-             static_cast<int>(con->getID ()),  con->getIpAddr (),
-             static_cast<int>(con->getPort ()),
-             con->getLocalIpAddr (),  static_cast<int>(con->getLocalPort ()),
-             con->getLogin (), con->getPassword ());
+    snprintf (arg->buffer, arg->bufferSize, "%i - %s - %i - %s - %i - %s - 
%s\r\n",
+              static_cast<int>(con->getID ()),  con->getIpAddr (),
+              static_cast<int>(con->getPort ()),
+              con->getLocalIpAddr (),  static_cast<int>(con->getLocalPort ()),
+              con->getLogin (), con->getPassword ());
 
     ret = arg->out->writeToFile (arg->buffer, strlen (arg->buffer), &nbw);
 



commit a0f649bb5861d3dd1bf05a888bbcd9f911a52d29
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Apr 8 17:51:28 2010 +0200

    Use getpeername/getsockopt/recvfrom/sendto/sigpipe modules from gnulib

diff --git a/myserver/bootstrap.conf b/myserver/bootstrap.conf
index 03f3b98..68d1a90 100644
--- a/myserver/bootstrap.conf
+++ b/myserver/bootstrap.conf
@@ -34,8 +34,10 @@ connect
 c++defs
 fsync
 getcwd
+getpeername
 gethostname
 getsockname
+getsockopt
 gettext
 gettimeofday
 ioctl
@@ -48,13 +50,16 @@ pipe
 read-file
 readlink
 recv
+recvfrom
 regex
 remove
 rename
 select
 send
+sendto
 setsockopt
 shutdown
+sigpipe
 snprintf
 socket
 sysexits



commit 06307ce6567dd2068de625af4f3c003fa564345d
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Apr 8 17:50:36 2010 +0200

    Do not use libtool to generate the final shared object

diff --git a/myserver/binaries/web/cgi-src/math_sum/Makefile.am 
b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
index 85d7d6d..0536ca9 100644
--- a/myserver/binaries/web/cgi-src/math_sum/Makefile.am
+++ b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
@@ -19,16 +19,22 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libmath_sum.la
 libmath_sum_la_SOURCES = math_sum.cpp
-libmath_sum_la_LDFLAGS = -avoid-version -module -shared
+libmath_sum_la_LDFLAGS = -no-undefined -avoid-version -module -shared
 libmath_sum_la_LIBADD = ../../../../src/libmyserver.a ../../../../lib/libgnu.a
 SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; 
s/^.*="\(.*\)"/\1/'`
 
 all: all-am math_sum.mscgi
 
 math_sum.mscgi: libmath_sum.la
-       $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) 
\
-               $(INSTALL_STRIP_FLAG) libmath_sum.la $(abs_builddir)
-       cp libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
+#      $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) 
\
+#               $(INSTALL_STRIP_FLAG) libmath_sum.la $(abs_builddir)
+#      cp libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+       $(CXX) $(libmath_sum_a_OBJECTS) $(libmath_sum_la_LIBADD)  $(CXXFLAGS) \
+       $(XML_CFLAGS) $(libmath_sum_a_LIBADD) $(PTHREAD_LIB) \
+       $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(SSL_LIB)  $(ZLIB_LIB) \
+       $(XML_LIBS) $(LDFLAGS) $(LIBINTL) -shared -o 
../../cgi-bin/math_sum.mscgi
+
 
 clean-local:
        test \! -e libmath_sum.la || \
diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am 
b/myserver/binaries/web/cgi-src/post/Makefile.am
index dc621be..6a28e94 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -19,16 +19,22 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libpost.la
 libpost_la_SOURCES = post.cpp
-libpost_la_LDFLAGS = -avoid-version -module -shared
+libpost_la_LDFLAGS = -no-undefined -avoid-version -module -shared
 libpost_la_LIBADD = ../../../../src/libmyserver.a ../../../../lib/libgnu.a
 SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; 
s/^.*="\(.*\)"/\1/'`
 
 all: all-am post.mscgi
 
 post.mscgi: libpost.la
-       $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) 
\
-               $(INSTALL_STRIP_FLAG) libpost.la $(abs_builddir)
-       cp libpost$(SO_EXT) ../../cgi-bin/post.mscgi
+#      $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) 
\
+#               $(INSTALL_STRIP_FLAG) libpost.la $(abs_builddir)
+#      cp libpost$(SO_EXT) ../../cgi-bin/post.mscgi
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+       $(CXX) $(libpost_a_OBJECTS) $(libpost_la_LIBADD)  $(CXXFLAGS) \
+       $(XML_CFLAGS) $(libpost_a_LIBADD) $(PTHREAD_LIB) \
+       $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(SSL_LIB)  $(ZLIB_LIB) \
+       $(XML_LIBS) $(LDFLAGS) $(LIBINTL) -shared -o ../../cgi-bin/post.mscgi
+
 
 clean-local:
        test \! -e libpost.la || \



commit 7f8a33e420343c5b5bcd9afc95c28d6471ab621e
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Apr 8 15:03:28 2010 +0200

    Use gnulib pipe wrappers under Windows.

diff --git a/myserver/include/base/pipe/pipe.h 
b/myserver/include/base/pipe/pipe.h
index 7530bc0..32994fe 100644
--- a/myserver/include/base/pipe/pipe.h
+++ b/myserver/include/base/pipe/pipe.h
@@ -45,11 +45,6 @@ public:
   int waitForData (int sec, int usec);
 private:
   bool terminated;
-# ifndef WIN32
   int handles[2];
-# else
-  HANDLE readHandle;
-  HANDLE writeHandle;
-# endif
 };
 #endif
diff --git a/myserver/src/base/pipe/pipe.cpp b/myserver/src/base/pipe/pipe.cpp
index 733e764..d0a614e 100644
--- a/myserver/src/base/pipe/pipe.cpp
+++ b/myserver/src/base/pipe/pipe.cpp
@@ -21,7 +21,6 @@
 #include <include/base/utility.h>
 #include <include/base/pipe/pipe.h>
 
-#ifndef WIN32
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -34,10 +33,6 @@
 # include <math.h>
 # include <time.h>
 
-#else
-# include <windows.h>
-#endif
-
 #include <string>
 #include <sstream>
 
@@ -52,7 +47,6 @@ using namespace std;
 int Pipe::read (char* buffer, u_long len, u_long *nbr)
 {
   *nbr = 0;
-#ifndef WIN32
   int ret = ::read (handles[0], buffer, len);
   if (ret == -1)
     {
@@ -69,22 +63,6 @@ int Pipe::read (char* buffer, u_long len, u_long *nbr)
       *nbr = (u_long)ret;
     }
   return 0;
-#else
-  if ( !ReadFile (readHandle, buffer, len, nbr, NULL) || !nbr)
-    {
-      *nbr = 0;
-      if (GetLastError () != ERROR_BROKEN_PIPE)
-        return 1;
-      else
-        {
-          terminated = true;
-          return 0;
-        }
-    }
-  return 0;
-#endif
-
-  return 0;
 }
 
 
@@ -95,43 +73,7 @@ int Pipe::read (char* buffer, u_long len, u_long *nbr)
  */
 int Pipe::create (bool readPipe)
 {
-#ifndef WIN32
   return pipe (handles);
-#else
-  HANDLE tmp;
-  SECURITY_ATTRIBUTES sa;
-  sa.nLength = sizeof (SECURITY_ATTRIBUTES);
-  sa.bInheritHandle = TRUE;
-  sa.lpSecurityDescriptor = NULL;
-  if (!CreatePipe (&readHandle, &writeHandle, &sa, 0))
-    return 1;
-
-  if (readPipe)
-    {
-      if (!DuplicateHandle (GetCurrentProcess (), readHandle,
-                            GetCurrentProcess (), &tmp, 0,
-                            FALSE, DUPLICATE_SAME_ACCESS))
-        {
-          close ();
-          return 1;
-        }
-      CloseHandle (readHandle);
-      readHandle = tmp;
-    }
-  else
-    {
-      if (!DuplicateHandle (GetCurrentProcess (), writeHandle,
-                            GetCurrentProcess (), &tmp, 0,
-                            FALSE, DUPLICATE_SAME_ACCESS))
-        {
-          close ();
-          return 1;
-        }
-      CloseHandle (writeHandle);
-      writeHandle = tmp;
-    }
-  return 0;
-#endif
 }
 
 /*!
@@ -143,7 +85,6 @@ int Pipe::create (bool readPipe)
 int Pipe::write (const char* buffer, u_long len, u_long *nbw)
 {
   *nbw = 0;
-#ifndef WIN32
   int ret = gnulib::write (handles[1], buffer, len);
   if (ret == -1)
     {
@@ -152,9 +93,7 @@ int Pipe::write (const char* buffer, u_long len, u_long *nbw)
     }
   else
     *nbw = (u_long) ret;
-#else
-  return !WriteFile (writeHandle, buffer, len, nbw, NULL);
-#endif
+
   return 0;
 }
 
@@ -163,11 +102,7 @@ int Pipe::write (const char* buffer, u_long len, u_long 
*nbw)
  */
 long Pipe::getReadHandle ()
 {
-#ifndef WIN32
   return handles[0];
-#else
-  return (long)readHandle;
-#endif
 }
 
 /*!
@@ -175,11 +110,7 @@ long Pipe::getReadHandle ()
  */
 long Pipe::getWriteHandle ()
 {
-#ifndef WIN32
   return handles[1];
-#else
-  return (long)writeHandle;
-#endif
 }
 
 
@@ -189,21 +120,13 @@ long Pipe::getWriteHandle ()
 int Pipe::close ()
 {
   terminated = true;
-#ifndef WIN32
   if (handles[0] >= 0)
     gnulib::close (handles[0]);
   if (handles[1] >= 0)
     gnulib::close (handles[1]);
 
   handles[0] = handles[1] = -1;
-#else
-  if (readHandle >= 0)
-    CloseHandle (readHandle);
-  if (writeHandle >= 0)
-    CloseHandle (writeHandle);
-
-  readHandle = writeHandle = 0;
-#endif
+
   return 0;
 }
 
@@ -231,7 +154,6 @@ private:
  */
 void Pipe::inverted (Pipe& pipe)
 {
-#ifndef WIN32
   pipe.handles[0] = gnulib::dup (handles[1]);
   pipe.handles[1] = gnulib::dup (handles[0]);
   if (pipe.handles[0] < 0 || pipe.handles[1] < 0)
@@ -239,27 +161,12 @@ void Pipe::inverted (Pipe& pipe)
       string err (_("Internal error"));
       throw PipeException (err);
     }
-#else
-  if ((! DuplicateHandle (GetCurrentProcess(), writeHandle, 
GetCurrentProcess(),
-                          &pipe.readHandle, 0, FALSE, DUPLICATE_SAME_ACCESS))
-      || (! DuplicateHandle (GetCurrentProcess(), readHandle,
-                             GetCurrentProcess(), &pipe.writeHandle, 0, FALSE,
-                             DUPLICATE_SAME_ACCESS)))
-    {
-      string err (_("Internal error"));
-      throw PipeException (err);
-    }
-#endif
 }
 
 Pipe::Pipe ()
 {
   terminated = false;
-#ifndef WIN32
   handles[0] = handles[1] = -1;
-#else
-  readHandle = writeHandle = (HANDLE) -1;
-#endif
 }
 
 Pipe::~Pipe ()
@@ -273,15 +180,9 @@ Pipe::~Pipe ()
 void Pipe::closeRead ()
 {
   terminated = true;
-#ifndef WIN32
   if (handles[0] >= 0)
     gnulib::close (handles[0]);
   handles[0] = -1;
-#else
-  if (readHandle >= 0)
-    CloseHandle (readHandle);
-  readHandle = (HANDLE) -1;
-#endif
 }
 
 /*!
@@ -290,15 +191,9 @@ void Pipe::closeRead ()
 void Pipe::closeWrite ()
 {
   terminated = true;
-#ifndef WIN32
   if (handles[1] >= 0)
     gnulib::close (handles[1]);
   handles[1] = -1;
-#else
-  if (writeHandle >= 0)
-    CloseHandle (writeHandle);
-  writeHandle = (HANDLE) -1;
-#endif
 }
 
 /*!
@@ -309,28 +204,6 @@ void Pipe::closeWrite ()
  */
 int Pipe::waitForData (int sec, int usec)
 {
-#ifdef WIN32
-  /*FIXME: avoid polling.  */
-  u_long limit = getTicks () + sec * 1000 + usec/1000;
-  char buffer[1];
-  DWORD bytesRead;
-
-  do
-    {
-      bytesRead = 0;
-      if (PeekNamedPipe (readHandle, buffer, 1, &bytesRead, NULL, NULL) == 0)
-        return 0;
-
-      if (bytesRead)
-        return 1;
-
-      Thread::wait (1000);
-    }
-  while (getTicks () < limit);
-
-  return 0;
-
-#else
   struct timeval tv;
   fd_set readfds;
   int ret;
@@ -350,6 +223,4 @@ int Pipe::waitForData (int sec, int usec)
     return 1;
 
   return 0;
-#endif
-  return 0;
 }



commit b174a314e45e54354e357e030f21fc852edcdfbc
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Apr 8 12:36:25 2010 +0200

    Now MYSERVER_SEC converts seconds to microseconds.

diff --git a/myserver/include/base/utility.h b/myserver/include/base/utility.h
index 475cfa4..5c22658 100644
--- a/myserver/include/base/utility.h
+++ b/myserver/include/base/utility.h
@@ -32,7 +32,7 @@ using namespace std;
 
 # define MYSERVER_KB(x) (x << 10)
 # define MYSERVER_MB(x) (x << 20)
-# define MYSERVER_SEC(x) (x * 1000)
+# define MYSERVER_SEC(x) (x * 1000000)
 
 int preparePrintError ();
 int endPrintError ();

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

Summary of changes:
 myserver/binaries/web/cgi-src/math_sum/Makefile.am |   14 ++-
 myserver/binaries/web/cgi-src/post/Makefile.am     |   14 ++-
 myserver/bootstrap.conf                            |    5 +
 myserver/configure.ac                              |    2 +-
 myserver/include/base/pipe/pipe.h                  |    5 -
 myserver/include/base/utility.h                    |    2 +-
 myserver/myserver.h                                |    2 -
 myserver/src/base/base64/mime_utils.cpp            |    6 +-
 myserver/src/base/crypt/crypt_algo_manager.cpp     |    3 +-
 myserver/src/base/pipe/pipe.cpp                    |  135 +-------------------
 myserver/src/base/socket/socket.cpp                |    2 +-
 myserver/src/base/socket_pair/socket_pair.cpp      |   27 ++--
 myserver/src/protocol/control/control_protocol.cpp |   16 +-
 13 files changed, 55 insertions(+), 178 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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