myserver-commit
[Top][All Lists]
Advanced

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

[myserver-commit] [2822] Refactoring.


From: Giuseppe Scrivano
Subject: [myserver-commit] [2822] Refactoring.
Date: Thu, 18 Sep 2008 18:23:59 +0000

Revision: 2822
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2822
Author:   gscrivano
Date:     2008-09-18 18:23:58 +0000 (Thu, 18 Sep 2008)

Log Message:
-----------
Refactoring.  Now `File', `Pipe' and `Socket' use close inherited by `Stream'.

Modified Paths:
--------------
    trunk/myserver/control/control_client.cpp
    trunk/myserver/control/myserver-configure.cpp
    trunk/myserver/include/base/file/file.h
    trunk/myserver/include/base/files_cache/cached_file.h
    trunk/myserver/include/base/pipe/pipe.h
    trunk/myserver/include/base/process/process_server_manager.h
    trunk/myserver/include/base/socket/socket.h
    trunk/myserver/include/base/socket/ssl_socket.h
    trunk/myserver/include/filter/stream.h
    trunk/myserver/src/base/file/file.cpp
    trunk/myserver/src/base/files_cache/cached_file.cpp
    trunk/myserver/src/base/files_cache/cached_file_buffer.cpp
    trunk/myserver/src/base/files_cache/cached_file_factory.cpp
    trunk/myserver/src/base/home_dir/home_dir.cpp
    trunk/myserver/src/base/pipe/pipe.cpp
    trunk/myserver/src/base/process/process_server_manager.cpp
    trunk/myserver/src/base/socket/socket.cpp
    trunk/myserver/src/base/socket/ssl_socket.cpp
    trunk/myserver/src/conf/mime/mime_manager.cpp
    trunk/myserver/src/conf/vhost/vhost_manager.cpp
    trunk/myserver/src/connection/connection.cpp
    trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
    trunk/myserver/src/connections_scheduler/listen_threads.cpp
    trunk/myserver/src/filter/stream.cpp
    trunk/myserver/src/http_handler/cgi/cgi.cpp
    trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp
    trunk/myserver/src/http_handler/http_dir/http_dir.cpp
    trunk/myserver/src/http_handler/http_file/http_file.cpp
    trunk/myserver/src/http_handler/scgi/scgi.cpp
    trunk/myserver/src/http_handler/wincgi/wincgi.cpp
    trunk/myserver/src/log/log_manager.cpp
    trunk/myserver/src/plugin/executor/dynamic_executor.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/protocol/http/http_data_read.cpp
    trunk/myserver/src/server/server.cpp

Modified: trunk/myserver/control/control_client.cpp
===================================================================
--- trunk/myserver/control/control_client.cpp   2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/control/control_client.cpp   2008-09-18 18:23:58 UTC (rev 
2822)
@@ -41,7 +41,7 @@
    memset(UserPass, 0, 64); // no memory snoops here
    Buffer.free();
    if(Connected)
-     socket->closesocket();
+     socket->close();
         if(socket)
                 delete socket;
 }
@@ -91,7 +91,7 @@
    /*! If the socket was created try to connect. */
    if(tcpSocket->connect((MYSERVER_SOCKADDR*)&sockAddr, sockLen) == -1)
      {
-       socket->closesocket();
+       socket->close();
        delete tcpSocket;
        return -2;
      }
@@ -127,7 +127,7 @@
    memset(UserPass, 0, 64); // no memory snoops here
    Buffer.setLength(0);
    if(Connected)
-     socket->closesocket();
+     socket->close();
    Connected = false;
    return 0;
 }

Modified: trunk/myserver/control/myserver-configure.cpp
===================================================================
--- trunk/myserver/control/myserver-configure.cpp       2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/control/myserver-configure.cpp       2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -170,8 +170,8 @@
                    break;
                  outputF.writeToFile(buffer, nbr, &nbw);
               }
-            inputF.closeFile();
-            outputF.closeFile();
+            inputF.close();
+            outputF.close();
 
             if(FilesUtility::fileExists("MIMEtypes.xml.default"))
               {
@@ -186,8 +186,8 @@
                         break;
                       outputF.writeToFile(buffer, nbr, &nbw);
                    }
-                 inputF.closeFile();
-                 outputF.closeFile();
+                 inputF.close();
+                 outputF.close();
               }
 
             if(FilesUtility::fileExists("virtualhosts.xml.default"))
@@ -205,8 +205,8 @@
                         break;
                       outputF.writeToFile(buffer, nbr, &nbw);
                    }
-                 inputF.closeFile();
-                 outputF.closeFile();
+                 inputF.close();
+                 outputF.close();
               }
          }
      }

Modified: trunk/myserver/include/base/file/file.h
===================================================================
--- trunk/myserver/include/base/file/file.h     2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/include/base/file/file.h     2008-09-18 18:23:58 UTC (rev 
2822)
@@ -65,7 +65,7 @@
     {return setFilename(name.c_str());}
 
        virtual int operator =(File);
-       virtual int closeFile();
+       virtual int close();
 
   /*! Inherithed from Stream. */
   virtual int read(char* buffer, u_long len, u_long *nbr);

Modified: trunk/myserver/include/base/files_cache/cached_file.h
===================================================================
--- trunk/myserver/include/base/files_cache/cached_file.h       2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/include/base/files_cache/cached_file.h       2008-09-18 
18:23:58 UTC (rev 2822)
@@ -45,7 +45,7 @@
        virtual int setFilePointer(u_long);
 
        virtual int operator =(CachedFile);
-       virtual int closeFile();
+       virtual int close();
 
   /*! Inherithed from Stream. */
   virtual int write(const char* buffer, u_long len, u_long *nbw);

Modified: trunk/myserver/include/base/pipe/pipe.h
===================================================================
--- trunk/myserver/include/base/pipe/pipe.h     2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/include/base/pipe/pipe.h     2008-09-18 18:23:58 UTC (rev 
2822)
@@ -36,7 +36,7 @@
        void inverted(Pipe&);
   virtual int read(char* buffer, u_long len, u_long *nbr);
   virtual int write(const char* buffer, u_long len, u_long *nbw);
-       void close();
+       virtual int close();
        void closeRead();
        void closeWrite();
        bool pipeTerminated(){return terminated;}

Modified: trunk/myserver/include/base/process/process_server_manager.h
===================================================================
--- trunk/myserver/include/base/process/process_server_manager.h        
2008-09-17 19:32:47 UTC (rev 2821)
+++ trunk/myserver/include/base/process/process_server_manager.h        
2008-09-18 18:23:58 UTC (rev 2822)
@@ -57,7 +57,7 @@
                {
                        if(isLocal)
                        {
-                               socket.closesocket();
+                               socket.close();
                                process.terminateProcess();
                        }
                }

Modified: trunk/myserver/include/base/socket/socket.h
===================================================================
--- trunk/myserver/include/base/socket/socket.h 2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/include/base/socket/socket.h 2008-09-18 18:23:58 UTC (rev 
2822)
@@ -96,7 +96,7 @@
        int setsockopt(int,int, const char*,int);
 
        virtual int connect(MYSERVER_SOCKADDR*, int);
-       virtual int closesocket();
+       virtual int close();
        virtual int shutdown(int how);
        virtual int recv(char*, int, int, u_long);
        virtual int recv(char*, int, int);

Modified: trunk/myserver/include/base/socket/ssl_socket.h
===================================================================
--- trunk/myserver/include/base/socket/ssl_socket.h     2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/include/base/socket/ssl_socket.h     2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -62,7 +62,7 @@
        SSL* getSSLConnection();
 #endif
 
-       virtual int closesocket();
+       virtual int close();
        virtual int shutdown(int how);
        virtual int connect(MYSERVER_SOCKADDR* sa, int na);
        virtual int recv(char* buffer,int len,int flags);

Modified: trunk/myserver/include/filter/stream.h
===================================================================
--- trunk/myserver/include/filter/stream.h      2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/include/filter/stream.h      2008-09-18 18:23:58 UTC (rev 
2822)
@@ -38,6 +38,7 @@
   virtual int write(const char* buffer, u_long len, u_long*);
        virtual int flush(u_long*);
   virtual FileHandle getHandle();
+  virtual int close();
   Stream();
   /*! Avoid direct instances of this class. */
   virtual ~Stream() = 0;

Modified: trunk/myserver/src/base/file/file.cpp
===================================================================
--- trunk/myserver/src/base/file/file.cpp       2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/base/file/file.cpp       2008-09-18 18:23:58 UTC (rev 
2822)
@@ -164,7 +164,7 @@
       ret = setFilePointer(0);
       if(ret)
       {
-        closeFile();
+        close();
         filename.clear();
         return 1;
       }
@@ -356,7 +356,7 @@
 /*!
  *Close an open base/file/file.handle.
  */
-int File::closeFile()
+int File::close()
 {
   int ret = 0;
   if(handle)
@@ -367,7 +367,7 @@
 #endif
 #ifdef NOT_WIN
     ret = fsync((long)handle);
-    ret |= close((long)handle);
+    ret |= ::close((long)handle);
 #endif
   }
   filename.clear();

Modified: trunk/myserver/src/base/files_cache/cached_file.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file.cpp 2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/base/files_cache/cached_file.cpp 2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -155,7 +155,7 @@
 /*!
  *Close an open base/file/file.handle.
  */
-int CachedFile::closeFile()
+int CachedFile::close()
 {
   buffer->decRef();
   return 0;

Modified: trunk/myserver/src/base/files_cache/cached_file_buffer.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file_buffer.cpp  2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/base/files_cache/cached_file_buffer.cpp  2008-09-18 
18:23:58 UTC (rev 2822)
@@ -64,7 +64,7 @@
 
   file.read(buffer, fileSize, &nbw);
 
-  file.closeFile();
+  file.close();
 }
 
 /*!

Modified: trunk/myserver/src/base/files_cache/cached_file_factory.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2008-09-18 
18:23:58 UTC (rev 2822)
@@ -209,7 +209,7 @@
       if(record == 0)
       {
         delete record;
-        file->closeFile();
+        file->close();
         delete file;
         mutex.unlock();
         return 0;
@@ -219,7 +219,7 @@
       record->mtime = file->getLastModTime();
 
       
-      file->closeFile();
+      file->close();
       delete file;
 
       if(buffer == 0)

Modified: trunk/myserver/src/base/home_dir/home_dir.cpp
===================================================================
--- trunk/myserver/src/base/home_dir/home_dir.cpp       2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/base/home_dir/home_dir.cpp       2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -145,7 +145,7 @@
   timestamp = usersFile.getLastModTime();
   if(size == (u_long) -1)
   {
-    usersFile.closeFile();
+    usersFile.close();
     return 1;
   }
 
@@ -201,7 +201,7 @@
     /* Next tuple.  */
   }
   delete [] buffer;
-  usersFile.closeFile();
+  usersFile.close();
 #endif
 
   loaded = 1;

Modified: trunk/myserver/src/base/pipe/pipe.cpp
===================================================================
--- trunk/myserver/src/base/pipe/pipe.cpp       2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/base/pipe/pipe.cpp       2008-09-18 18:23:58 UTC (rev 
2822)
@@ -192,7 +192,7 @@
 /*!
  *Close the pipe.
  */
-void Pipe::close()
+int Pipe::close()
 {
   terminated = true;
 #ifdef NOT_WIN
@@ -208,6 +208,7 @@
     CloseHandle(writeHandle);
   readHandle = writeHandle = 0;
 #endif
+  return 0;
 }
 
 /*!

Modified: trunk/myserver/src/base/process/process_server_manager.cpp
===================================================================
--- trunk/myserver/src/base/process/process_server_manager.cpp  2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/base/process/process_server_manager.cpp  2008-09-18 
18:23:58 UTC (rev 2822)
@@ -216,7 +216,7 @@
   
   if(s && s->isLocal && !s->process.isProcessAlive())
   {
-    s->socket.closesocket();
+    s->socket.close();
     s->process.terminateProcess();
     if(!s->path.length())
       s->path.assign(name);
@@ -459,20 +459,20 @@
         spi.stdOut = spi.stdError =(FileHandle) -1;
         if(server->process.execConcurrentProcess(&spi) == -1)
         {
-          server->socket.closesocket();
+          server->socket.close();
           //return 1; allow IPv6
         }
         
       }
       else
       {
-        server->socket.closesocket();
+        server->socket.close();
         //return 1; allow IPv6
     }
     }
     else
     {
-      server->socket.closesocket();
+      server->socket.close();
       //return 1; allow IPv6
     }
   }
@@ -490,12 +490,12 @@
       if(server->socket.bind(&serverSockAddrIn,
                              sizeof(sockaddr_in6)))
       {
-        server->socket.closesocket();
+        server->socket.close();
         return 1;
       }
       if(server->socket.listen(SOMAXCONN))
       {
-        server->socket.closesocket();
+        server->socket.close();
         return 1;
       }
       server->DESCRIPTOR.fileHandle = server->socket.getHandle();
@@ -509,7 +509,7 @@
 
       if(server->process.execConcurrentProcess(&spi) == -1)
       {
-        server->socket.closesocket();
+        server->socket.close();
         return 1;
       }
     }
@@ -538,7 +538,7 @@
     /*! If the socket was created try to connect.  */
     if(sock->connect(server->host.c_str(), server->port) == -1)
     {
-      sock->closesocket();
+      sock->close();
       return -1;
     }
 
@@ -552,7 +552,7 @@
     /*! If the socket was created try to connect.  */
     if(sock->connect(server->host, server->port) == -1)
     {
-      sock->closesocket();
+      sock->close();
       return -1;
     }
   }

Modified: trunk/myserver/src/base/socket/socket.cpp
===================================================================
--- trunk/myserver/src/base/socket/socket.cpp   2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/base/socket/socket.cpp   2008-09-18 18:23:58 UTC (rev 
2822)
@@ -215,7 +215,7 @@
 /*!
  *Close the socket.
  */
-int Socket::closesocket()
+int Socket::close()
 {
 #ifdef WIN32
   if(socketHandle)
@@ -554,7 +554,7 @@
     if(Socket::connect((MYSERVER_SOCKADDR*)(&connectionSockAddrIn), 
                        nSockLen) == -1)
     {
-      Socket::closesocket();
+      Socket::close();
     }
     else
     {
@@ -587,7 +587,7 @@
   sockAddr.sin_port = htons(port);
   if(Socket::connect((MYSERVER_SOCKADDR*)&sockAddr, sockLen) == -1)
   {
-    Socket::closesocket();
+    Socket::close();
     return -1;
   }
 #endif

Modified: trunk/myserver/src/base/socket/ssl_socket.cpp
===================================================================
--- trunk/myserver/src/base/socket/ssl_socket.cpp       2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/base/socket/ssl_socket.cpp       2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -63,12 +63,12 @@
 /*!
  *Close the socket.
  */
-int SslSocket::closesocket()
+int SslSocket::close()
 {
 #ifndef DO_NOT_USE_SSL
   freeSSL();
 #endif
-  return Socket::closesocket();
+  return Socket::close();
 }
 
 /*!
@@ -152,7 +152,7 @@
   if(SSL_connect(sslConnection) < 0)
   {
     SSL_CTX_free(sslContext);
-    closesocket();
+    close();
     sslContext = 0;
     return -1;
   }
@@ -229,7 +229,7 @@
   {
     shutdown(2);
     freeSSL();
-    closesocket();
+    close();
     return -1;
   }
   
@@ -243,7 +243,7 @@
   {
     shutdown(2);
     freeSSL();
-    closesocket();
+    close();
     return -1;
   }
   SSL_set_read_ahead(sslConnection, 0);
@@ -254,7 +254,7 @@
   {
     shutdown(2);
     freeSSL();
-    closesocket();
+    close();
     return -1;
   }
 #endif

Modified: trunk/myserver/src/conf/mime/mime_manager.cpp
===================================================================
--- trunk/myserver/src/conf/mime/mime_manager.cpp       2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/conf/mime/mime_manager.cpp       2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -381,7 +381,7 @@
     f.writeToFile("</MANAGER>\r\n</MIMETYPE>\r\n", 25, &nbw);  
   }
   f.writeToFile("\r\n</MIMETYPES>", 14, &nbw);
-  f.closeFile();
+  f.close();
 
   rwLock.writeUnlock();
   return 1;

Modified: trunk/myserver/src/conf/vhost/vhost_manager.cpp
===================================================================
--- trunk/myserver/src/conf/vhost/vhost_manager.cpp     2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/conf/vhost/vhost_manager.cpp     2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -741,7 +741,7 @@
       }
     }
     out.writeToFile("</VHOSTS>\r\n", 11, &nbw);
-    out.closeFile();
+    out.close();
     mutex.unlock();
   }
   catch(...)

Modified: trunk/myserver/src/connection/connection.cpp
===================================================================
--- trunk/myserver/src/connection/connection.cpp        2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/connection/connection.cpp        2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -58,7 +58,7 @@
       err = socket->recv(buffer, buffersize, 0);
     }while((err != -1) && err);
 
-    socket->closesocket();
+    socket->close();
     delete socket;
   }
 

Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
===================================================================
--- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp  
2008-09-17 19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp  
2008-09-18 18:23:58 UTC (rev 2822)
@@ -56,13 +56,13 @@
     e = bind(listener, (const struct sockaddr*) &addr, sizeof(addr));
     if (e == SOCKET_ERROR)
     {
-        closesocket(listener);
+        close(listener);
         return -1;
     }
     e = getsockname(listener, (struct sockaddr*) &addr, &addrlen);
     if (e == SOCKET_ERROR)
     {
-        closesocket(listener);
+        close(listener);
         return -1;
     }
 
@@ -77,13 +77,13 @@
       if ((socks[1] = accept(listener, NULL, NULL)) == INVALID_SOCKET)
         break;
       
-      closesocket(listener);
+      close(listener);
       return 0;
     } while (0);
 
-    closesocket(listener);
-    closesocket(socks[0]);
-    closesocket(socks[1]);
+    close(listener);
+    close(socks[0]);
+    close(socks[1]);
     return -1;
   #endif
 }
@@ -663,7 +663,7 @@
     {
       ConnectionPtr c = *it;
       if ( c->allowDelete(true) && c->socket)
-        c->socket->closesocket();
+        c->socket->close();
     }
   }
   catch(...)

Modified: trunk/myserver/src/connections_scheduler/listen_threads.cpp
===================================================================
--- trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-18 
18:23:58 UTC (rev 2822)
@@ -498,7 +498,7 @@
         err = serverSocket->recv(buffer, 256, 0);
       }while(err != -1);
 
-      serverSocket->closesocket();
+      serverSocket->close();
       delete serverSocket;
     }
     delete (*it);

Modified: trunk/myserver/src/filter/stream.cpp
===================================================================
--- trunk/myserver/src/filter/stream.cpp        2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/filter/stream.cpp        2008-09-18 18:23:58 UTC (rev 
2822)
@@ -31,6 +31,15 @@
 }
 
 /*!
+ *Close the stream.
+ *\return -1 on errors.
+ */
+int Stream::close()
+{
+  return 0;
+}
+
+/*!
  *Write [len] characters to the stream. Returns -1 on errors.
  */
 int Stream::write(const char* buffer, u_long len, u_long *nbw)

Modified: trunk/myserver/src/http_handler/cgi/cgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/cgi/cgi.cpp 2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/http_handler/cgi/cgi.cpp 2008-09-18 18:23:58 UTC (rev 
2822)
@@ -311,7 +311,7 @@
   {
     if( cgiProc.execConcurrentProcess(&spi) == -1)
     {
-      stdInFile.closeFile();
+      stdInFile.close();
       stdOutFile.close();
       td->connection->host->warningsLogRequestAccess(td->id);
       td->connection->host->warningsLogWrite
@@ -351,7 +351,7 @@
                        td->buffer2->getRealLength() - headerOffset - 1, 
                        &nBytesRead))
     {
-      stdInFile.closeFile();
+      stdInFile.close();
       stdOutFile.close();
       td->connection->host->warningsLogRequestAccess(td->id);
       td->connection->host->warningsLogWrite
@@ -386,7 +386,7 @@
       td->connection->host->warningsLogTerminateAccess(td->id);
       td->http->raiseHTTPError(500);
       stdOutFile.close();
-      stdInFile.closeFile();
+      stdInFile.close();
       chain.clearAllFilters(); 
       cgiProc.terminateProcess();
       return 0;
@@ -449,7 +449,7 @@
       {
         td->http->sendHTTPRedirect(location->c_str());
         stdOutFile.close();
-        stdInFile.closeFile();
+        stdInFile.close();
         chain.clearAllFilters(); 
         cgiProc.terminateProcess();
         return 1;
@@ -463,7 +463,7 @@
       if(chain.write(td->buffer->getBuffer(),
                      static_cast<int>(td->buffer->getLength()), &nbw2))
       {
-        stdInFile.closeFile();
+        stdInFile.close();
         stdOutFile.close();
         chain.clearAllFilters(); 
         /* Remove the connection on sockets error.  */
@@ -476,7 +476,7 @@
   if(!nph && onlyHeader)
   {
     stdOutFile.close();
-    stdInFile.closeFile();
+    stdInFile.close();
     chain.clearAllFilters(); 
     cgiProc.terminateProcess();
     return 1;
@@ -494,7 +494,7 @@
     td->connection->host->warningsLogWrite("Cgi: Error loading filters");
     td->connection->host->warningsLogTerminateAccess(td->id);
     stdOutFile.close();
-    stdInFile.closeFile();
+    stdInFile.close();
     cgiProc.terminateProcess();
     chain.clearAllFilters(); 
     return td->http->raiseHTTPError(500);
@@ -512,7 +512,7 @@
                                                 useChunks))
     {
       stdOutFile.close();
-      stdInFile.closeFile();
+      stdInFile.close();
       chain.clearAllFilters(); 
       /* Remove the connection on sockets error.  */
       cgiProc.terminateProcess();
@@ -531,7 +531,7 @@
     if((int)(getTicks() - procStartTime) > cgiTimeout)
     {
       stdOutFile.close();
-      stdInFile.closeFile();
+      stdInFile.close();
       chain.clearAllFilters(); 
       /* Remove the connection on sockets error.  */
       cgiProc.terminateProcess();
@@ -546,7 +546,7 @@
                        &nBytesRead))
     {
       stdOutFile.close();
-      stdInFile.closeFile();
+      stdInFile.close();
       chain.clearAllFilters(); 
       /* Remove the connection on sockets error.  */
       cgiProc.terminateProcess();
@@ -566,7 +566,7 @@
                                                 useChunks))
     {
       stdOutFile.close();
-      stdInFile.closeFile();
+      stdInFile.close();
       chain.clearAllFilters(); 
       /* Remove the connection on sockets error.  */
       cgiProc.terminateProcess();
@@ -581,7 +581,7 @@
   if(useChunks && chain.write("0\r\n\r\n", 5, &nbw2))
   {
     stdOutFile.close();
-    stdInFile.closeFile();
+    stdInFile.close();
     chain.clearAllFilters(); 
   
     /* Remove the connection on sockets error.  */
@@ -598,7 +598,7 @@
 
   /* Close the stdin and stdout files used by the CGI.  */
   stdOutFile.close();
-  stdInFile.closeFile();
+  stdInFile.close();
 
   /* Delete the file only if it was created by the CGI module.  */
   if(!td->inputData.getHandle())

Modified: trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -218,7 +218,7 @@
     chain.clearAllFilters();
     return td->http->raiseHTTPError(500);
   }
-  td->inputData.closeFile();
+  td->inputData.close();
   if(td->inputData.openFile(td->inputDataPath, File::MYSERVER_OPEN_READ | 
                             File::MYSERVER_OPEN_ALWAYS |
                             File::MYSERVER_NO_INHERIT))
@@ -269,7 +269,7 @@
       td->connection->host->warningsLogTerminateAccess(td->id);
     }
     chain.clearAllFilters();
-    con.sock.closesocket();
+    con.sock.close();
     return td->http->raiseHTTPError(500);
   }
 
@@ -285,7 +285,7 @@
       td->connection->host->warningsLogTerminateAccess(td->id);
     }
     chain.clearAllFilters();
-    con.sock.closesocket();
+    con.sock.close();
     return td->http->raiseHTTPError(501);
   }
 
@@ -300,7 +300,7 @@
       td->connection->host->warningsLogTerminateAccess(td->id);
     }
     chain.clearAllFilters();
-    con.sock.closesocket();
+    con.sock.close();
     return td->http->raiseHTTPError(500);
   }
 
@@ -375,7 +375,7 @@
 
       td->connection->host->warningsLogTerminateAccess(td->id);
     }
-    con.sock.closesocket();
+    con.sock.close();
     return td->http->raiseHTTPError(500);
   }
 
@@ -437,7 +437,7 @@
       td->connection->host->warningsLogTerminateAccess(td->id);
       sendFcgiBody(&con, 0, 0, FCGIABORT_REQUEST, id);
       con.sock.shutdown(2);
-      con.sock.closesocket();
+      con.sock.close();
       break;
     }
     /*!
@@ -458,7 +458,7 @@
       switch(header.type)
       {
         case FCGISTDERR:
-          con.sock.closesocket();
+          con.sock.close();
           td->http->raiseHTTPError(501);
           exit = 1;
           ret = 0;
@@ -529,9 +529,9 @@
   if((!ret) || con.tempOut.readFromFile(buffer, 
                                         td->buffer->getRealLength(), &nbr))
   {
-    con.tempOut.closeFile();
+    con.tempOut.close();
     FilesUtility::deleteFile(outDataPath.c_str());
-    con.sock.closesocket();
+    con.sock.close();
     chain.clearAllFilters();
     return td->http->sendHTTPhardError500();
   }
@@ -562,9 +562,9 @@
     u_long nbw2;
     if(td->response.location[0])
     {
-      con.tempOut.closeFile();
+      con.tempOut.close();
       FilesUtility::deleteFile(outDataPath.c_str());
-      con.sock.closesocket();
+      con.sock.close();
       chain.clearAllFilters();
       return td->http->sendHTTPRedirect((char*)td->response.location.c_str());
     }
@@ -712,9 +712,9 @@
     break;
   }
   chain.clearAllFilters();
-  con.tempOut.closeFile();
+  con.tempOut.close();
   FilesUtility::deleteFile(outDataPath.c_str());
-  con.sock.closesocket();
+  con.sock.close();
   return ret;
 }
 

Modified: trunk/myserver/src/http_handler/http_dir/http_dir.cpp
===================================================================
--- trunk/myserver/src/http_handler/http_dir/http_dir.cpp       2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp       2008-09-18 
18:23:58 UTC (rev 2822)
@@ -292,7 +292,7 @@
   if(ret)
   {
     /* Return an internal server error. */
-    td->outputData.closeFile();
+    td->outputData.close();
     chain.clearAllFilters(); 
     return td->http->raiseHTTPError(500);
   }
@@ -314,7 +314,7 @@
 
   if(ret)
   {
-    td->outputData.closeFile();
+    td->outputData.close();
     /* Return an internal server error.  */
     return td->http->raiseHTTPError(500);
   }
@@ -357,7 +357,7 @@
 
   if(ret)
   {
-    td->outputData.closeFile();
+    td->outputData.close();
     chain.clearAllFilters(); 
     /* Return an internal server error.  */
     return td->http->raiseHTTPError(500);
@@ -386,7 +386,7 @@
     if(ret)
     {
       fd.findclose();
-      td->outputData.closeFile();
+      td->outputData.close();
       chain.clearAllFilters(); 
       /* Return an internal server error.  */
       return td->http->raiseHTTPError(500);
@@ -479,7 +479,7 @@
                                   td->appendOutputs, useChunks);
     if(ret)
     {
-      td->outputData.closeFile();
+      td->outputData.close();
       chain.clearAllFilters(); 
       /* Return an internal server error.  */
       return td->http->raiseHTTPError(500);
@@ -515,7 +515,7 @@
 
   if(ret)
   {
-    td->outputData.closeFile();
+    td->outputData.close();
     /* Return an internal server error.  */
     return td->http->raiseHTTPError(500);
   }  

Modified: trunk/myserver/src/http_handler/http_file/http_file.cpp
===================================================================
--- trunk/myserver/src/http_handler/http_file/http_file.cpp     2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/http_handler/http_file/http_file.cpp     2008-09-18 
18:23:58 UTC (rev 2822)
@@ -122,7 +122,7 @@
     ret = file->setFilePointer(firstByte);
     if(ret)
     {
-      file->closeFile();
+      file->close();
       delete file;
       return td->http->raiseHTTPError(500);
     }
@@ -216,7 +216,7 @@
                                                            &memStream, 
                                                            &nbw))
       {
-        file->closeFile();
+        file->close();
         delete file;
         chain.clearAllFilters();
         return 0;
@@ -233,7 +233,7 @@
       u_long nbw;
       if(!gzipFilter)
       {
-        file->closeFile();
+        file->close();
         delete file;
         chain.clearAllFilters();
         return 0;
@@ -241,7 +241,7 @@
       if(chain.addFilter(gzipFilter, &nbw))
       {
         delete gzipFilter;
-        file->closeFile();
+        file->close();
         delete file;
         chain.clearAllFilters();
         return 0;
@@ -311,7 +311,7 @@
       if(s->socket->send(td->buffer->getBuffer(), 
                          (u_long)td->buffer->getLength(), 0) == SOCKET_ERROR)
       {
-        file->closeFile();
+        file->close();
         delete file;
         chain.clearAllFilters();
         return 1;
@@ -324,7 +324,7 @@
      */
     if(onlyHeader)
     {
-      file->closeFile();
+      file->close();
       delete file;
       chain.clearAllFilters();
       return 0;
@@ -344,7 +344,7 @@
       off_t offset = firstByte;
       ret = sendfile(s->socket->getHandle(), file->getHandle(),
                      &offset, bytesToSend);
-      file->closeFile();
+      file->close();
       delete file;
       chain.clearAllFilters();
 
@@ -373,7 +373,7 @@
       
       if(ret)
       {
-        file->closeFile();
+        file->close();
         delete file;
         chain.clearAllFilters();
         return 0;
@@ -391,7 +391,7 @@
                                                     td->appendOutputs, 
                                                     useChunks))
         {
-          file->closeFile();
+          file->close();
           delete file;
           chain.clearAllFilters();
           return 1;
@@ -502,12 +502,12 @@
 
     }/* End for loop.  */
 
-    file->closeFile();
+    file->close();
     delete file;
   }
   catch(bad_alloc &ba)
   {
-    file->closeFile();
+    file->close();
     delete file;
     s->host->warningsLogRequestAccess(td->id);
     s->host->warningsLogWrite("HttpFile: Error allocating memory");
@@ -517,7 +517,7 @@
   }
   catch(...)
   {
-    file->closeFile();
+    file->close();
     delete file;
     s->host->warningsLogRequestAccess(td->id);
     s->host->warningsLogWrite("HttpFile: Internal error");

Modified: trunk/myserver/src/http_handler/scgi/scgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/scgi/scgi.cpp       2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/http_handler/scgi/scgi.cpp       2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -184,7 +184,7 @@
     chain.clearAllFilters();
     return td->http->raiseHTTPError(500);
   }
-  td->inputData.closeFile();
+  td->inputData.close();
   if(td->inputData.openFile(td->inputDataPath, File::MYSERVER_OPEN_READ | 
                             File::MYSERVER_OPEN_ALWAYS |
                             File::MYSERVER_NO_INHERIT))
@@ -233,9 +233,9 @@
 
 
   chain.clearAllFilters();
-  con.tempOut.closeFile();
+  con.tempOut.close();
 
-  con.sock.closesocket();
+  con.sock.close();
   return ret;
 }
 

Modified: trunk/myserver/src/http_handler/wincgi/wincgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/wincgi/wincgi.cpp   2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/http_handler/wincgi/wincgi.cpp   2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -279,7 +279,7 @@
   sprintf(buffer, "Debug Mode=No\r\n", bias);
   DataFileHandle.writeToFile(buffer, 15, &nbr);
 
-  DataFileHandle.closeFile();
+  DataFileHandle.close();
 
   /*
    *Create the out file.
@@ -293,14 +293,14 @@
       td->connection->host->warningsLogWrite(
                                       "WinCGI: Error creating output file");
       td->connection->host->warningsLogTerminateAccess(td->id);
-      DataFileHandle.closeFile();
+      DataFileHandle.close();
       FilesUtility::deleteFile(outFilePath);
       FilesUtility::deleteFile(dataFilePath);
       chain.clearAllFilters(); 
       return td->http->raiseHTTPError(500);
     }
   }
-  OutFileHandle.closeFile();
+  OutFileHandle.close();
   spi.cmdLine.assign("cmd /c \"");
   spi.cmdLine.append(filename);
   spi.cmdLine.append("\" ");
@@ -341,7 +341,7 @@
     td->connection->host->warningsLogRequestAccess(td->id);
     td->connection->host->warningsLogWrite(msg.str().c_str());
     td->connection->host->warningsLogTerminateAccess(td->id);
-    OutFileHandle.closeFile();
+    OutFileHandle.close();
     FilesUtility::deleteFile(outFilePath);
     FilesUtility::deleteFile(dataFilePath);
     chain.clearAllFilters();
@@ -385,7 +385,7 @@
                           (int)strlen((const char*)td->buffer->getBuffer()), 
                    &nbw2))
     {
-      OutFileHandle.closeFile();
+      OutFileHandle.close();
       FilesUtility::deleteFile(outFilePath);
       FilesUtility::deleteFile(dataFilePath);
       chain.clearAllFilters();
@@ -394,7 +394,7 @@
       
     if(onlyHeader)
     {
-      OutFileHandle.closeFile();
+      OutFileHandle.close();
       FilesUtility::deleteFile(outFilePath);
       FilesUtility::deleteFile(dataFilePath);
       chain.clearAllFilters();
@@ -436,7 +436,7 @@
         ret = td->outputData.writeToFile(buffer, nBytesRead, &nbw);
         if(ret)
         {
-          OutFileHandle.closeFile();
+          OutFileHandle.close();
           FilesUtility::deleteFile(outFilePath);
           FilesUtility::deleteFile(dataFilePath);
           chain.clearAllFilters();
@@ -449,7 +449,7 @@
         ret = chain.write((char*)buffer, nBytesRead, &nbw2);
         if(ret == -1)
         {
-          OutFileHandle.closeFile();
+          OutFileHandle.close();
           FilesUtility::deleteFile(outFilePath);
           FilesUtility::deleteFile(dataFilePath);
           chain.clearAllFilters();
@@ -465,7 +465,7 @@
   td->sentData += nbw;
 
   chain.clearAllFilters();  
-  OutFileHandle.closeFile();
+  OutFileHandle.close();
   FilesUtility::deleteFile(outFilePath);
   FilesUtility::deleteFile(dataFilePath);
   return 1;

Modified: trunk/myserver/src/log/log_manager.cpp
===================================================================
--- trunk/myserver/src/log/log_manager.cpp      2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/log/log_manager.cpp      2008-09-18 18:23:58 UTC (rev 
2822)
@@ -96,7 +96,7 @@
 int LogManager::close()
 {
   if(loaded)
-    file.closeFile();
+    file.close();
   return 0;
 }
 
@@ -280,7 +280,7 @@
       {
         delete [] buffer;
         delete [] buffer2;
-        newFile.closeFile();
+        newFile.close();
         return 1;
       }
       if(gzipLog)
@@ -291,7 +291,7 @@
         {
           delete [] buffer;
           delete [] buffer2;
-          newFile.closeFile();
+          newFile.close();
           return 1;
         }  
         gzip.initialize();
@@ -305,7 +305,7 @@
         {
           delete [] buffer;
           delete [] buffer2;      
-          newFile.closeFile();
+          newFile.close();
           return 1;
         }    
         if(nbr == 0)
@@ -318,7 +318,7 @@
           {
             delete [] buffer;
             delete [] buffer2;
-            newFile.closeFile();
+            newFile.close();
             return 1;
           } 
         }
@@ -326,7 +326,7 @@
         {
           delete [] buffer;
           delete [] buffer2;
-          newFile.closeFile();
+          newFile.close();
           return 1;
         } 
       }
@@ -338,7 +338,7 @@
         {
           delete [] buffer;
           delete [] buffer2;
-          newFile.closeFile();
+          newFile.close();
           return 1;
         }  
         len=gzip.getFooter(gzipData, 16);
@@ -346,13 +346,13 @@
         {
           delete [] buffer;
           delete [] buffer2;
-          newFile.closeFile();
+          newFile.close();
           return 1;
         }   
         gzip.free();
       }
-      newFile.closeFile();
-      currentFile->closeFile();
+      newFile.close();
+      currentFile->close();
       FilesUtility::deleteFile(filepath.c_str());
       if(currentFile->openFile(filepath.c_str(), File::MYSERVER_OPEN_APPEND|
                                File::MYSERVER_OPEN_ALWAYS | 
File::MYSERVER_OPEN_WRITE |

Modified: trunk/myserver/src/plugin/executor/dynamic_executor.cpp
===================================================================
--- trunk/myserver/src/plugin/executor/dynamic_executor.cpp     2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/plugin/executor/dynamic_executor.cpp     2008-09-18 
18:23:58 UTC (rev 2822)
@@ -108,7 +108,7 @@
   if(buffer)
     delete []buffer;
 
-  file.closeFile();
+  file.close();
   
   return ret;
 }

Modified: trunk/myserver/src/protocol/control/control_protocol.cpp
===================================================================
--- trunk/myserver/src/protocol/control/control_protocol.cpp    2008-09-17 
19:32:47 UTC (rev 2821)
+++ trunk/myserver/src/protocol/control/control_protocol.cpp    2008-09-18 
18:23:58 UTC (rev 2822)
@@ -291,7 +291,7 @@
       strcpy(b2,"Control: Error in the temporary file creation");
       addToErrorLog(a,b2, strlen(b2), header);
       sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
-      Ifile->closeFile();
+      Ifile->close();
       FilesUtility::deleteFile(IfilePath.str().c_str());
       delete Ifile;
       return 0;
@@ -306,7 +306,7 @@
         strcpy(b2,"Control: Error writing to temporary file");
         addToErrorLog(a,b2, strlen(b2), header);
         sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
-        Ifile->closeFile();
+        Ifile->close();
         FilesUtility::deleteFile(IfilePath.str().c_str());
         delete Ifile;
         Ifile=0;
@@ -329,7 +329,7 @@
           strcpy(b2,"Control: Error in communication");
           addToErrorLog(a,b2, strlen(b2), header);
           sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
-          Ifile->closeFile();
+          Ifile->close();
           FilesUtility::deleteFile(IfilePath.str().c_str());
           delete Ifile;
           Ifile=0;
@@ -342,7 +342,7 @@
           strcpy(b2,"Control: Error trying to write on the temporary file");
           addToErrorLog(a,b2, strlen(b2), header);
           sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
-          Ifile->closeFile();
+          Ifile->close();
           FilesUtility::deleteFile(IfilePath.str().c_str());
           delete Ifile;
           Ifile=0;
@@ -357,7 +357,7 @@
         strcpy(b2,"Control: Bad content length specified");
         addToErrorLog(a,b2, strlen(b2), header);
         sendResponse(b2, bs2, a, CONTROL_BAD_LEN, header, 0);
-        Ifile->closeFile();
+        Ifile->close();
         FilesUtility::deleteFile(IfilePath.str().c_str());
         delete Ifile;
         Ifile=0;
@@ -381,7 +381,7 @@
     addToErrorLog(a,b2, strlen(b2), header);
     if(Ifile)
     {
-      Ifile->closeFile();
+      Ifile->close();
       FilesUtility::deleteFile(IfilePath.str().c_str());
       delete Ifile;
       Ifile=0;
@@ -401,7 +401,7 @@
     addToErrorLog(a,b2, strlen(b2), header);
     if(Ifile)
     {
-      Ifile->closeFile();
+      Ifile->close();
       FilesUtility::deleteFile(IfilePath.str().c_str());
       delete Ifile;
       Ifile=0;
@@ -419,7 +419,7 @@
     addToErrorLog(a,b2, strlen(b2), header);
     if(Ifile)
     {
-      Ifile->closeFile();
+      Ifile->close();
       FilesUtility::deleteFile(IfilePath.str().c_str());
       delete Ifile;
       Ifile=0;
@@ -443,7 +443,7 @@
     strcpy(b2,"Control: Error in allocating memory");
     addToErrorLog(a,b2, strlen(b2), header);
     sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
-    Ifile->closeFile();
+    Ifile->close();
     FilesUtility::deleteFile(IfilePath.str().c_str());
     delete Ifile;
     Ifile=0;
@@ -459,7 +459,7 @@
     addToErrorLog(a,b2, strlen(b2), header);
     sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
     delete Ofile;
-    Ifile->closeFile();
+    Ifile->close();
     delete Ifile;
 
     FilesUtility::deleteFile(IfilePath.str().c_str());
@@ -540,13 +540,13 @@
       sendResponse(b2, bs2, a, CONTROL_OK, header, Ofile);
     if(Ifile)
     {
-      Ifile->closeFile();
+      Ifile->close();
       delete Ifile;
       Ifile=0;
     }
     if(Ofile)
     {
-      Ofile->closeFile();
+      Ofile->close();
       delete Ofile;
       Ofile=0;
     }
@@ -570,13 +570,13 @@
 
     if(Ifile)
     {
-      Ifile->closeFile();
+      Ifile->close();
       delete Ifile;
       Ifile=0;
     }
     if(Ofile)
     {
-      Ofile->closeFile();
+      Ofile->close();
       delete Ofile;
       Ofile=0;
     }
@@ -933,7 +933,7 @@
 
   }
 
-  localfile.closeFile();
+  localfile.close();
   return 0;
 }
 
@@ -1031,7 +1031,7 @@
       return CONTROL_INTERNAL;
     }
   }
-  localfile.closeFile();
+  localfile.close();
   
   if(isAutoRebootToEnable)
     Server::getInstance()->enableAutoReboot();

Modified: trunk/myserver/src/protocol/ftp/ftp.cpp
===================================================================
--- trunk/myserver/src/protocol/ftp/ftp.cpp     2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/protocol/ftp/ftp.cpp     2008-09-18 18:23:58 UTC (rev 
2822)
@@ -162,7 +162,7 @@
   if ( m_pDataConnection != NULL && m_pDataConnection->socket != NULL )
   {
     m_pDataConnection->socket->shutdown(SD_BOTH);
-    m_pDataConnection->socket->closesocket();
+    m_pDataConnection->socket->close();
     delete m_pDataConnection->socket;
     m_pDataConnection->socket = NULL;
     m_pDataConnection->setScheduled(0);
@@ -585,7 +585,7 @@
       return;
 
     pFtpUserData->m_pDataConnection->socket->shutdown(SD_BOTH);
-    pFtpUserData->m_pDataConnection->socket->closesocket();
+    pFtpUserData->m_pDataConnection->socket->close();
     delete pFtpUserData->m_pDataConnection->socket;
     pFtpUserData->m_pDataConnection->socket = new Socket(asock);
   }
@@ -780,7 +780,7 @@
       if ( file->readFromFile(buffer.getBuffer(), nBufferSize, &nbr) )
       {
         ftp_reply(pConnection, 451);
-        file->closeFile();
+        file->close();
         delete file;
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
@@ -799,7 +799,7 @@
       if ( pLine == NULL )
       {
         ftp_reply(pConnection, 451);
-        file->closeFile();
+        file->close();
         delete file;
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
@@ -835,8 +835,8 @@
           (u_long)buffer2.getLength(), 0) == SOCKET_ERROR )
             {
         ftp_reply(pConnection, 451);
-               file->closeFile();
-        file->closeFile();
+               file->close();
+        file->close();
         delete file;
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
@@ -850,7 +850,7 @@
       if ( pFtpUserData->m_bBreakDataConnection )
       {
         pFtpUserData->m_bBreakDataConnection = false;
-               file->closeFile();
+               file->close();
         delete file;
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
@@ -862,13 +862,13 @@
 #endif
       }
     }
-    file->closeFile();
+    file->close();
     delete file;
   }
   catch (bad_alloc &ba)
   {
     if ( file != NULL )
-      file->closeFile();
+      file->close();
     delete file;
     //report error
   }
@@ -1015,7 +1015,7 @@
           (u_long)nBufferSize, 0) == SOCKET_ERROR )
       {
         ftp_reply(pConnection, 451);
-        file->closeFile();
+        file->close();
         delete file;
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
@@ -1032,7 +1032,7 @@
       if ( pFtpUserData->m_bBreakDataConnection )
       {
         pFtpUserData->m_bBreakDataConnection = false;
-               file->closeFile();
+               file->close();
         delete file;
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
@@ -1044,13 +1044,13 @@
 #endif
       }
     }
-    file->closeFile();
+    file->close();
     delete file;
   }
   catch (bad_alloc &ba)
   {
     if ( file != NULL )
-      file->closeFile();
+      file->close();
     delete file;
     //report error
   }
@@ -1195,7 +1195,7 @@
       if ( pLine == NULL )
       {
         ftp_reply(pConnection, 451);
-        file.closeFile();
+        file.close();
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
         delete pWt;
@@ -1235,7 +1235,7 @@
       if ( pFtpUserData->m_bBreakDataConnection )
       {
         pFtpUserData->m_bBreakDataConnection = false;
-               file.closeFile();
+               file.close();
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
         delete pWt;
@@ -1247,11 +1247,11 @@
       }
       memset(buffer.getBuffer(), 0, buffer.getRealLength());
     }
-    file.closeFile();
+    file.close();
   }
   catch (bad_alloc &ba)
   {
-    file.closeFile();
+    file.close();
     //report error
   }
 
@@ -1386,7 +1386,7 @@
       if ( pFtpUserData->m_bBreakDataConnection )
       {
         pFtpUserData->m_bBreakDataConnection = false;
-               file.closeFile();
+               file.close();
         pFtpUserData->CloseDataConnection();
         pFtpUserData->m_DataConnBusy.unlock();
         delete pWt;
@@ -1397,12 +1397,12 @@
 #endif
       }
     }
-    file.closeFile();
+    file.close();
   }
   catch (bad_alloc &ba)
   {
     //report error
-    file.closeFile();
+    file.close();
   }
 
   ftp_reply(pConnection, 226);

Modified: trunk/myserver/src/protocol/http/http.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http.cpp   2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/protocol/http/http.cpp   2008-09-18 18:23:58 UTC (rev 
2822)
@@ -261,7 +261,7 @@
         if(td->inputData.readFromFile(td->buffer->getBuffer(),
                                      td->buffer->getRealLength(), &nbr))
         {
-          file.closeFile();
+          file.close();
           /*! Return an internal server error.  */
           return raiseHTTPError(500);
         }
@@ -269,7 +269,7 @@
         {
           if(file.writeToFile(td->buffer->getBuffer(), nbr, &nbw))
           {
-            file.closeFile();
+            file.close();
             /*! Return an internal server error.  */
             return raiseHTTPError(500);
           }
@@ -278,12 +278,12 @@
           break;
         if(nbw != nbr)
         {
-          file.closeFile();
+          file.close();
           /*! Internal server error.  */
           return raiseHTTPError(500);
         }
       }
-      file.closeFile();
+      file.close();
       /*! Successful updated.  */
       raiseHTTPError(200);
 
@@ -308,14 +308,14 @@
         if(td->inputData.readFromFile(td->buffer->getBuffer(),
                                       td->buffer->getRealLength(), &nbr))
         {
-          file.closeFile();
+          file.close();
           return raiseHTTPError(500);
         }
         if(nbr)
         {
           if(file.writeToFile(td->buffer->getBuffer(), nbr, &nbw))
           {
-            file.closeFile();
+            file.close();
             return raiseHTTPError(500);
           }
         }
@@ -323,11 +323,11 @@
           break;
         if( nbw != nbr )
         {
-          file.closeFile();
+          file.close();
           return raiseHTTPError(500);
         }
       }
-      file.closeFile();
+      file.close();
       /*! Successful created. */
       raiseHTTPError(201);
       return 1;
@@ -1170,12 +1170,12 @@
 
       if(h.readFromFile(linkpath, linkpathSize, &nbr))
       {
-        h.closeFile();
+        h.close();
         delete [] linkpath;
         return raiseHTTPError(500);/*!Internal server error*/
       }
 
-      h.closeFile();
+      h.close();
       linkpath[nbr]='\0';
 
       pathInfo = new char[td->pathInfo.length() + 1];
@@ -1565,7 +1565,7 @@
          */
         if(td->inputData.getHandle())
         {
-          td->inputData.closeFile();
+          td->inputData.close();
           FilesUtility::deleteFile(td->inputDataPath);
         }
 
@@ -1574,7 +1574,7 @@
          */
         if(td->outputData.getHandle())
         {
-          td->outputData.closeFile();
+          td->outputData.close();
           FilesUtility::deleteFile(td->outputDataPath);
         }
         logHTTPaccess();
@@ -1610,7 +1610,7 @@
            */
           if(td->inputData.getHandle())
           {
-            td->inputData.closeFile();
+            td->inputData.close();
             FilesUtility::deleteFile(td->inputDataPath);
           }
           /*!
@@ -1618,7 +1618,7 @@
            */
           if(td->outputData.getHandle())
           {
-            td->outputData.closeFile();
+            td->outputData.close();
             FilesUtility::deleteFile(td->outputDataPath);
           }
           logHTTPaccess();
@@ -1817,7 +1817,7 @@
      */
     if(td->inputData.getHandle())
     {
-      td->inputData.closeFile();
+      td->inputData.close();
       FilesUtility::deleteFile(td->inputDataPath);
     }
     /*
@@ -1825,7 +1825,7 @@
      */
     if(td->outputData.getHandle())
     {
-      td->outputData.closeFile();
+      td->outputData.close();
       FilesUtility::deleteFile(td->outputDataPath);
     }
 

Modified: trunk/myserver/src/protocol/http/http_data_read.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http_data_read.cpp 2008-09-17 19:32:47 UTC 
(rev 2821)
+++ trunk/myserver/src/protocol/http/http_data_read.cpp 2008-09-18 18:23:58 UTC 
(rev 2822)
@@ -344,7 +344,7 @@
       {
         td->inputDataPath.assign("");
         td->outputDataPath.assign("");
-        td->inputData.closeFile();
+        td->inputData.close();
         return -1;
       }
       else if(ret)
@@ -373,7 +373,7 @@
                                        &nbr,
                                        timeout))
     {
-      td->inputData.closeFile();
+      td->inputData.close();
       FilesUtility::deleteFile(td->inputDataPath);
       *httpRetCode = 400;
       return 1;
@@ -383,7 +383,7 @@
       length -= nbr;
     else
     {
-      td->inputData.closeFile();
+      td->inputData.close();
       FilesUtility::deleteFile(td->inputDataPath);
       *httpRetCode = 400;
       return 1;
@@ -395,7 +395,7 @@
     {
       td->inputDataPath.assign("");
       td->outputDataPath.assign("");
-      td->inputData.closeFile();
+      td->inputData.close();
       return -1;
     }
 

Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp        2008-09-17 19:32:47 UTC (rev 
2821)
+++ trunk/myserver/src/server/server.cpp        2008-09-18 18:23:58 UTC (rev 
2822)
@@ -1232,7 +1232,7 @@
     s.shutdown(2);
 
     /* Then close it.  */
-    s.closesocket();
+    s.close();
   }
   return ret;
 }
@@ -1597,8 +1597,8 @@
 
       FilesUtility::copyFile(inputF, outputF);
 
-      inputF.closeFile();
-      outputF.closeFile();
+      inputF.close();
+      outputF.close();
     }
     else
     {
@@ -1673,8 +1673,8 @@
 
       FilesUtility::copyFile(inputF, outputF);
 
-      inputF.closeFile();
-      outputF.closeFile();
+      inputF.close();
+      outputF.close();
     }
 
   }
@@ -1747,8 +1747,8 @@
 
       FilesUtility::copyFile(inputF, outputF);
 
-      inputF.closeFile();
-      outputF.closeFile();
+      inputF.close();
+      outputF.close();
     }
   }
   catch (...)






reply via email to

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