myserver-commit
[Top][All Lists]
Advanced

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

[myserver-commit] [2857] Fixed some warning messages.


From: Giuseppe Scrivano
Subject: [myserver-commit] [2857] Fixed some warning messages.
Date: Tue, 30 Sep 2008 20:33:12 +0000

Revision: 2857
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2857
Author:   gscrivano
Date:     2008-09-30 20:33:12 +0000 (Tue, 30 Sep 2008)

Log Message:
-----------
Fixed some warning messages.

Modified Paths:
--------------
    trunk/myserver/include/log/stream/log_stream.h
    trunk/myserver/include/server/server.h
    trunk/myserver/src/base/files_cache/cached_file_buffer.cpp
    trunk/myserver/src/base/socket/ssl_socket.cpp
    trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
    trunk/myserver/src/http_handler/http_dir/http_dir.cpp
    trunk/myserver/src/protocol/control/control_protocol.cpp
    trunk/myserver/src/protocol/ftp/ftp.cpp
    trunk/myserver/src/protocol/http/http.cpp
    trunk/myserver/src/server/server.cpp
    trunk/myserver/tests/main.cpp
    trunk/myserver/tests/test_base64.cpp
    trunk/myserver/tests/test_connections_scheduler.cpp
    trunk/myserver/tests/test_file_stream.cpp
    trunk/myserver/tests/test_files_utility.cpp
    trunk/myserver/tests/test_filter_chain.cpp
    trunk/myserver/tests/test_http_request.cpp
    trunk/myserver/tests/test_md5.cpp
    trunk/myserver/tests/test_mem_stream.cpp
    trunk/myserver/tests/test_mutex.cpp
    trunk/myserver/tests/test_thread.cpp
    trunk/myserver/tests/test_utility.cpp

Modified: trunk/myserver/include/log/stream/log_stream.h
===================================================================
--- trunk/myserver/include/log/stream/log_stream.h      2008-09-30 19:43:19 UTC 
(rev 2856)
+++ trunk/myserver/include/log/stream/log_stream.h      2008-09-30 20:33:12 UTC 
(rev 2857)
@@ -168,12 +168,6 @@
   
 
   /*!
-   * Will be zero after a successful call to the close method.
-   */
-  int isOpened;
-  
-
-  /*!
    * A zero value means `never cycle'. A non-zero value establishes
    * the maximum size allowed for the LogStream's growth before 
    * cycling it.
@@ -181,6 +175,12 @@
   u_long cycleLog;
 
 
+  /*!
+   * Will be zero after a successful call to the close method.
+   */
+  int isOpened;
+  
+
   FiltersChain* filtersChain;
 
 

Modified: trunk/myserver/include/server/server.h
===================================================================
--- trunk/myserver/include/server/server.h      2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/include/server/server.h      2008-09-30 20:33:12 UTC (rev 
2857)
@@ -186,7 +186,6 @@
   void *envString;
   VhostManager *vhostList;
   MimeManager *mimeManager;
-  ListenThreads listenThreads;
   HomeDir homeDir;
   HashMap<string, string*> hashedData;
   HashMap<string, void*> globalData;
@@ -252,6 +251,7 @@
   GenericPluginsManager genericPluginsManager;
   ProcessServerManager processServerManager;
   ConnectionsScheduler connectionsScheduler;
+  ListenThreads listenThreads;
   bool endServer;
 };
 

Modified: trunk/myserver/src/base/files_cache/cached_file_buffer.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file_buffer.cpp  2008-09-30 
19:43:19 UTC (rev 2856)
+++ trunk/myserver/src/base/files_cache/cached_file_buffer.cpp  2008-09-30 
20:33:12 UTC (rev 2857)
@@ -123,7 +123,6 @@
  */
 CachedFileBuffer::CachedFileBuffer(const char* buffer, u_long size)
 {
-  u_long nbr;
   factoryToNotify = 0;
   refCounter = 0;
 

Modified: trunk/myserver/src/base/socket/ssl_socket.cpp
===================================================================
--- trunk/myserver/src/base/socket/ssl_socket.cpp       2008-09-30 19:43:19 UTC 
(rev 2856)
+++ trunk/myserver/src/base/socket/ssl_socket.cpp       2008-09-30 20:33:12 UTC 
(rev 2857)
@@ -273,15 +273,23 @@
 #ifndef DO_NOT_USE_SSL
   if(sslConnection)
   {
-    do
+    for (;;)
     {
-        err = SSL_read(sslConnection, buffer, len);
-    }while((err <= 0) &&
-           (SSL_get_error(sslConnection,err) == SSL_ERROR_WANT_X509_LOOKUP)
-           || (SSL_get_error(sslConnection,err) == SSL_ERROR_WANT_READ)
-            || (SSL_get_error(sslConnection,err) == SSL_ERROR_WANT_WRITE));
+      int sslError;
+      err = SSL_read(sslConnection, buffer, len);
 
-    if(err <= 0)
+      if (err > 0)
+        break;
+
+      sslError = SSL_get_error (sslConnection, err);
+      
+      if ((sslError != SSL_ERROR_WANT_X509_LOOKUP) &&
+          (sslError != SSL_ERROR_WANT_READ) &&
+          (sslError != SSL_ERROR_WANT_WRITE))
+        break;
+    }
+
+    if (err <= 0)
       return -1;
     else
       return err;

Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
===================================================================
--- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp  
2008-09-30 19:43:19 UTC (rev 2856)
+++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp  
2008-09-30 20:33:12 UTC (rev 2857)
@@ -88,21 +88,6 @@
   #endif
 }
 
-static int
-make_socket_nonblocking(socket_t fd)
-{
-  #ifdef WIN32
-  {
-    unsigned long nonblocking = 1;
-    ioctlsocket(fd, FIONBIO, (unsigned long*) &nonblocking);
-  }
-  #else
-  if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
-    return -1;
-  }
-  #endif
-  return 0;
-}
 ///////////////////////////////////////////////////////////////////////////
 
 #ifdef WIN32
@@ -352,8 +337,6 @@
  */
 void ConnectionsScheduler::initialize()
 {
-  static timeval tv = {1, 0};
-
   event_init();
 
   dispatcherArg.terminated = true;
@@ -383,9 +366,6 @@
     return;
   }
 
-  //make_socket_nonblocking(dispatcherArg.fd[0]);
-  //make_socket_nonblocking(dispatcherArg.fd[1]);
-
   event_set(&(dispatcherArg.loopEvent), dispatcherArg.fd[0], EV_READ | 
EV_TIMEOUT,
          eventLoopHandler, &dispatcherArg);
 
@@ -550,8 +530,6 @@
 
     if(ready[currentPriority].size())
     {
-      FileHandle handle;
-
       ret = ready[currentPriority].front();
       ret->setScheduled(0);
       ready[currentPriority].pop();

Modified: trunk/myserver/src/http_handler/http_dir/http_dir.cpp
===================================================================
--- trunk/myserver/src/http_handler/http_dir/http_dir.cpp       2008-09-30 
19:43:19 UTC (rev 2856)
+++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp       2008-09-30 
20:33:12 UTC (rev 2857)
@@ -182,7 +182,6 @@
   int lastSlash = 0;
   bool useChunks = false;
   u_long sentData = 0;
-  int i;
   char fileTime[32];
   char* bufferloop;
   const char* browseDirCSSpath;

Modified: trunk/myserver/src/protocol/control/control_protocol.cpp
===================================================================
--- trunk/myserver/src/protocol/control/control_protocol.cpp    2008-09-30 
19:43:19 UTC (rev 2856)
+++ trunk/myserver/src/protocol/control/control_protocol.cpp    2008-09-30 
20:33:12 UTC (rev 2857)
@@ -750,9 +750,6 @@
 int ControlProtocol::killConnection(ConnectionPtr a, u_long id, File* out, 
                                     char *b1, int bs1, ControlHeader& header)
 {
-  int ret = 0;
-  ConnectionPtr con;
-
   if(id == 0)
     return -1;
 

Modified: trunk/myserver/src/protocol/ftp/ftp.cpp
===================================================================
--- trunk/myserver/src/protocol/ftp/ftp.cpp     2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/src/protocol/ftp/ftp.cpp     2008-09-30 20:33:12 UTC (rev 
2857)
@@ -1796,7 +1796,7 @@
 #ifdef NOT_WIN
       nlink_t nlink = 1;
       nlink = fd.getStatStruct()->st_nlink;
-      sprintf(nlinkStr, "%lu", nlink);
+      sprintf(nlinkStr, "%lu", (u_long) nlink);
 #endif
 
       char fdSizeStr[12];
@@ -1893,7 +1893,7 @@
 #ifdef NOT_WIN
       nlink_t nlink = 1;
       nlink = fd.getStatStruct()->st_nlink;
-      sprintf(nlinkStr, "%lu", nlink);
+      sprintf(nlinkStr, "%lu", (u_long) nlink);
 #endif
 
       char fdSizeStr[12];
@@ -1996,7 +1996,7 @@
   char *pIn = In.getBuffer();
   char szReply[3];
 
-    while ( pIn - In.getBuffer() < In.getLength() )
+  while ( (u_int) (pIn - In.getBuffer()) < In.getLength() )
     {
         if ( *pIn == '\377' )
         {

Modified: trunk/myserver/src/protocol/http/http.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http.cpp   2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/src/protocol/http/http.cpp   2008-09-30 20:33:12 UTC (rev 
2857)
@@ -709,14 +709,12 @@
    */
   string filename;
   int permissions;
-  int providedMask;
   string dirscan;
   int filenamePathLen;
   string data;
   int mimecmd;
   time_t lastMT;
   int ret;
-  char authType[16];
   string tmpTime;
   string directory;
   string file;

Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp        2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/src/server/server.cpp        2008-09-30 20:33:12 UTC (rev 
2857)
@@ -289,7 +289,6 @@
 void Server::start(string &mainConf, string &mimeConf, string &vhostConf, 
string &externPath, string &langPath)
 {
   int err = 0;
-  int ret;
 #ifdef WIN32
   DWORD eventsCount, cNumRead;
   INPUT_RECORD irInBuf[128];
@@ -691,8 +690,6 @@
  */
 void Server::displayBoot()
 {
-  u_long i;
-
 #ifdef CLEAR_BOOT_SCREEN
 
   if(logManager.getType() == LogManager::TYPE_CONSOLE )

Modified: trunk/myserver/tests/main.cpp
===================================================================
--- trunk/myserver/tests/main.cpp       2008-09-30 19:43:19 UTC (rev 2856)
+++ trunk/myserver/tests/main.cpp       2008-09-30 20:33:12 UTC (rev 2857)
@@ -23,8 +23,6 @@
 
 #include <string.h>
 
-char *versionOfSoftware = "MyServer";
-
 int main(int argc, char* argv[])
 {
   bool xml = argc > 1 && !strcmp(argv[1], "xml");

Modified: trunk/myserver/tests/test_base64.cpp
===================================================================
--- trunk/myserver/tests/test_base64.cpp        2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/tests/test_base64.cpp        2008-09-30 20:33:12 UTC (rev 
2857)
@@ -59,7 +59,7 @@
 
     CPPUNIT_ASSERT_EQUAL(strlen(input), strlen(decoded));
 
-    for (int i = 0; i < strlen(decoded); i++)
+    for (unsigned int i = 0; i < strlen(decoded); i++)
       CPPUNIT_ASSERT_EQUAL(input[i], decoded[i]);
 
   }

Modified: trunk/myserver/tests/test_connections_scheduler.cpp
===================================================================
--- trunk/myserver/tests/test_connections_scheduler.cpp 2008-09-30 19:43:19 UTC 
(rev 2856)
+++ trunk/myserver/tests/test_connections_scheduler.cpp 2008-09-30 20:33:12 UTC 
(rev 2857)
@@ -88,6 +88,7 @@
   virtual int visitConnection(ConnectionPtr conn, void* param)
   {
     arg = param;
+    return 0;
   }
 private:
   void *arg;
@@ -126,7 +127,6 @@
 
     void* arg = this;
     u_long max = 3;
-    u_long sum = 0;
 
     for(u_long i = 0; i < max; i++)
     {

Modified: trunk/myserver/tests/test_file_stream.cpp
===================================================================
--- trunk/myserver/tests/test_file_stream.cpp   2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/tests/test_file_stream.cpp   2008-09-30 20:33:12 UTC (rev 
2857)
@@ -49,7 +49,7 @@
     string message ("thisisaverylongmessage\n");
     string message2 ("thisisanothermessage\n");
     LogStream* ls = fsc->create (ff, "foo", filters, 10);
-    File* outStream = dynamic_cast<File*>(ls->getOutStream ());
+
     CPPUNIT_ASSERT (!ls->log (message));
     CPPUNIT_ASSERT (!ls->log (message2));
     ls->close ();

Modified: trunk/myserver/tests/test_files_utility.cpp
===================================================================
--- trunk/myserver/tests/test_files_utility.cpp 2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/tests/test_files_utility.cpp 2008-09-30 20:33:12 UTC (rev 
2857)
@@ -82,7 +82,6 @@
 
   void testSplitPath()
   {
-    char *path;
     char dir[256];
     char file[256];
 
@@ -106,7 +105,6 @@
 
   void testSplitPathLength()
   {
-    char *path;
     int dir;
     int file;
 

Modified: trunk/myserver/tests/test_filter_chain.cpp
===================================================================
--- trunk/myserver/tests/test_filter_chain.cpp  2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/tests/test_filter_chain.cpp  2008-09-30 20:33:12 UTC (rev 
2857)
@@ -76,7 +76,7 @@
     int i = nLength;
     while ( !fc->read(szTemp, 64, &nbw) && i > 0 )
     {
-      strncpy(pBuff, szTemp, nbw>i?i:nbw);
+      strncpy(pBuff, szTemp, (int)nbw > i ? i : nbw);
       pBuff += nbw;
       i -= nbw;
     }

Modified: trunk/myserver/tests/test_http_request.cpp
===================================================================
--- trunk/myserver/tests/test_http_request.cpp  2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/tests/test_http_request.cpp  2008-09-30 20:33:12 UTC (rev 
2857)
@@ -67,6 +67,7 @@
                                                         &header, 
                                                         &connection);
 
+    CPPUNIT_ASSERT_EQUAL(ret, 200);
     CPPUNIT_ASSERT(header.cmd.compare("GET") == 0);
     CPPUNIT_ASSERT(header.ver.compare("HTTP/1.1") == 0);
     CPPUNIT_ASSERT(header.uri.compare("/resource") == 0);

Modified: trunk/myserver/tests/test_md5.cpp
===================================================================
--- trunk/myserver/tests/test_md5.cpp   2008-09-30 19:43:19 UTC (rev 2856)
+++ trunk/myserver/tests/test_md5.cpp   2008-09-30 20:33:12 UTC (rev 2857)
@@ -44,7 +44,6 @@
 
   void testHash()
   {
-    const char* hex_chars = "0123456789abcdef";
     unsigned char out[33];
     const unsigned char* msg = (unsigned char* ) "hello world!\n";
 

Modified: trunk/myserver/tests/test_mem_stream.cpp
===================================================================
--- trunk/myserver/tests/test_mem_stream.cpp    2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/tests/test_mem_stream.cpp    2008-09-30 20:33:12 UTC (rev 
2857)
@@ -66,11 +66,8 @@
   
   void testAvailableToRead()
   {
-    u_long nbr;
     u_long size = addSomeData(stream);
 
-    char buffer[20];
-
     CPPUNIT_ASSERT_EQUAL(size, (u_long)stream->availableToRead());
   } 
 
@@ -119,7 +116,7 @@
   void testFlush()
   {
     u_long nbw;
-    u_long size = addSomeData(stream);
+    addSomeData(stream);
     int ret = stream->flush(&nbw);
     
     CPPUNIT_ASSERT(nbw >= 0);

Modified: trunk/myserver/tests/test_mutex.cpp
===================================================================
--- trunk/myserver/tests/test_mutex.cpp 2008-09-30 19:43:19 UTC (rev 2856)
+++ trunk/myserver/tests/test_mutex.cpp 2008-09-30 20:33:12 UTC (rev 2857)
@@ -52,6 +52,8 @@
     arg->value++;
     arg->mutex->unlock();
   }
+
+  return NULL;
 }
 
 

Modified: trunk/myserver/tests/test_thread.cpp
===================================================================
--- trunk/myserver/tests/test_thread.cpp        2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/tests/test_thread.cpp        2008-09-30 20:33:12 UTC (rev 
2857)
@@ -40,9 +40,9 @@
 
   *arg *= *arg;
 
+  return NULL;
 }
 
-
 #ifdef WIN32
 #define ClientsThread_TYPE int
 unsigned int __stdcall test_terminate_thread(void* pParam)
@@ -61,6 +61,8 @@
 
   //Should never be here.
   *arg = 1;
+
+  return NULL;
 }
 
 class TestThread : public CppUnit::TestFixture

Modified: trunk/myserver/tests/test_utility.cpp
===================================================================
--- trunk/myserver/tests/test_utility.cpp       2008-09-30 19:43:19 UTC (rev 
2856)
+++ trunk/myserver/tests/test_utility.cpp       2008-09-30 20:33:12 UTC (rev 
2857)
@@ -71,7 +71,7 @@
   void testCWD()
   {
     char *buffer;
-    int bufferLen;
+    unsigned int bufferLen;
 
     setcwdBuffer();
 






reply via email to

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