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. v0.9.2-471


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-471-gebe8e3b
Date: Fri, 22 Apr 2011 11:49:04 +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  ebe8e3b297859c444b3a4d57fe4bfbf5aaaffbbe (commit)
       via  5110fad6ca5ec2a6bbaa1aa63df54e348449e055 (commit)
       via  4b94a0f7b4e15c29b867a60cc4787b67f3d7dc17 (commit)
       via  dbee1d8ee189c245a878a4ac7a7e7516372acc89 (commit)
      from  3c79d69d6099d3b03026dd2ca8be30e8c67a24e3 (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 ebe8e3b297859c444b3a4d57fe4bfbf5aaaffbbe
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Apr 22 13:48:43 2011 +0200

    HttpHandler: refactor some code out of HttpFile.

diff --git a/myserver/include/protocol/http/http_data_handler.h 
b/myserver/include/protocol/http/http_data_handler.h
index cef8c27..c8f863f 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -55,17 +55,27 @@ public:
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          const char *buffer,
                                          size_t size,
-                                         FiltersChain *chain,
+                                         FiltersChain &chain,
                                          bool useChunks,
                                          size_t realBufferSize,
-                                         MemoryStream *tmpStream);
+                                         MemoryStream &tmpStream);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          const char *buffer,
                                          size_t size,
-                                         FiltersChain* chain,
+                                         FiltersChain &chain,
                                          bool useChunks);
 
+  static size_t beginHTTPResponse (HttpThreadContext *td,
+                                   MemoryStream &memStream,
+                                   FiltersChain &chain,
+                                   bool useChunks);
+
+  static size_t completeHTTPResponse (HttpThreadContext *td,
+                                      MemoryStream &memStream,
+                                      FiltersChain &chain,
+                                      bool useChunks);
+
 };
 
 #endif
diff --git a/myserver/src/http_handler/cgi/cgi.cpp 
b/myserver/src/http_handler/cgi/cgi.cpp
index d244283..4c820cb 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -346,7 +346,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, 
FiltersChain& chain,
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                   
td->auxiliaryBuffer->getBuffer (),
                                                   nBytesRead,
-                                                  &chain,
+                                                  chain,
                                                   useChunks);
     }
 
@@ -473,7 +473,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe 
&stdOutFile, FiltersChain &chai
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                td->auxiliaryBuffer->getBuffer () + headerSize,
                                                     headerOffset - headerSize,
-                                                    &chain,
+                                                    chain,
                                                     useChunks);
     }
 
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp 
b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 196b777..407cf11 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -623,7 +623,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long 
timeout,
   size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
                                             con->td->buffer->getBuffer (),
                                             con->td->buffer->getLength (),
-                                            chain, con->useChunks);
+                                            *chain, con->useChunks);
 
   con->td->sentData += nbw;
   return 0;
@@ -710,7 +710,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* 
chain, bool* response
       size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
                                                 con->td->buffer->getBuffer () 
+ headerSize,
                                                 size - headerSize,
-                                                chain,
+                                                *chain,
                                                 con->useChunks);
       con->td->sentData += nbw;
     }
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp 
b/myserver/src/http_handler/http_dir/http_dir.cpp
index fd666d0..9d1e801 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -438,7 +438,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, 
td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           &chain, useChunks);
+                                           chain, useChunks);
 
       filename = directory;
       td->auxiliaryBuffer->setLength (0);
@@ -453,7 +453,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, 
td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           &chain, useChunks);
+                                           chain, useChunks);
 
       fd.findfirst (filename.c_str ());
 
@@ -468,7 +468,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, 
td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength 
(),
-                                               &chain, useChunks);
+                                               chain, useChunks);
       td->auxiliaryBuffer->setLength (0);
 
       if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
@@ -504,7 +504,7 @@ int HttpDir::send (HttpThreadContext* td,
 
           td->sentData += appendDataToHTTPChannel (td, 
td->auxiliaryBuffer->getBuffer (),
                                                    
td->auxiliaryBuffer->getLength (),
-                                                   &chain, useChunks);
+                                                   chain, useChunks);
         }
 
       /* Put all files in a vector.  */
@@ -565,7 +565,7 @@ int HttpDir::send (HttpThreadContext* td,
           generateElement (*td->auxiliaryBuffer, file, linkPrefix, 
formatString);
           td->sentData += appendDataToHTTPChannel (td, 
td->auxiliaryBuffer->getBuffer (),
                                                    
td->auxiliaryBuffer->getLength (),
-                                                   &chain, useChunks);
+                                                   chain, useChunks);
         }
 
       td->auxiliaryBuffer->setLength (0);
@@ -589,7 +589,7 @@ int HttpDir::send (HttpThreadContext* td,
       *td->auxiliaryBuffer << "</address>\r\n</body>\r\n</html>\r\n";
       td->sentData += appendDataToHTTPChannel (td, 
td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength 
(),
-                                               &chain, useChunks);
+                                               chain, useChunks);
 
       *td->auxiliaryBuffer << end_str;
       /* Changes the \ character in the / character.  */
diff --git a/myserver/src/http_handler/http_file/http_file.cpp 
b/myserver/src/http_handler/http_file/http_file.cpp
index 72e2e9e..8fd89cd 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -425,25 +425,9 @@ int HttpFile::send (HttpThreadContext* td, const char 
*filenamePath,
 
     chain.setStream (td->connection->socket);
 
-    /*
-      Flush initial data.  This is data that filters could have added
-      and we have to send before the file itself, for example the gzip
-      filter add a header to file.
-    */
-    if (memStream.availableToRead ())
-      {
-        memStream.read (td->buffer->getBuffer (),
-                        td->buffer->getRealLength (), &nbr);
 
-        memStream.refresh ();
-        if (nbr)
-          {
-            FiltersChain directChain (chain.getStream ());
-            td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
-                                                    td->buffer->getBuffer (),
-                                                    nbr, &directChain, 
useChunks);
-          }
-      } /* memStream.availableToRead ().  */
+    td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream, chain,
+                                                        useChunks);
 
     /* Flush the rest of the file.  */
     for (;;)
@@ -452,7 +436,9 @@ int HttpFile::send (HttpThreadContext* td, const char 
*filenamePath,
         size_t nbw;
 
         /* Check if there are other bytes to send.  */
-        if (bytesToSend)
+        if (! bytesToSend)
+          break;
+        else
           {
             /* Read from the file the bytes to send.  */
             size_t size = std::min (td->buffer->getRealLength (), bytesToSend);
@@ -467,45 +453,14 @@ int HttpFile::send (HttpThreadContext* td, const char 
*filenamePath,
             bytesToSend -= nbr;
 
             td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer 
(),
-                                                     nbr, &chain, useChunks,
+                                                     nbr, chain, useChunks,
                                                      td->buffer->getRealLength 
(),
-                                                     &memStream);
+                                                     memStream);
           }
-        else /* if (bytesToSend) */
-          {
-            /* If we don't use chunks we can flush directly.  */
-            if (!useChunks)
-              {
-                chain.flush (&nbw);
-                td->sentData += nbw;
-                break;
-              }
-            else
-              {
-                /*
-                  Replace the final stream before the flush and write to a
-                  memory buffer, after all the data is flushed from the
-                  chain we can replace the stream with the original one and
-                  write there the HTTP data chunk.
-                */
-                Stream* tmpStream = chain.getStream ();
-                FiltersChain directChain (tmpStream);
-                memStream.refresh ();
-                chain.setStream (&memStream);
-                chain.flush (&nbw);
-                chain.setStream (tmpStream);
-                memStream.read (td->buffer->getBuffer (),
-                                td->buffer->getRealLength (), &nbr);
-
-                td->sentData += appendDataToHTTPChannel (td, 
td->buffer->getBuffer (),
-                                                         nbr, &directChain, 
useChunks);
-                chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
-                break;
-              }
-          }
-        memStream.refresh ();
       }/* End for loop.  */
 
+    td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
+
     file->close ();
     delete file;
   }
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp 
b/myserver/src/http_handler/mscgi/mscgi.cpp
index ee6d22b..9d0f9ff 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -169,8 +169,8 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* 
mcd)
 
   mcd->td->sentData +=
     HttpDataHandler::appendDataToHTTPChannel (mcd->td,
-                                              (char *) data, len,
-                                              mcd->filtersChain,
+                                              data, len,
+                                              *mcd->filtersChain,
                                               mcd->useChunks);
   return 0;
 }
diff --git a/myserver/src/http_handler/proxy/proxy.cpp 
b/myserver/src/http_handler/proxy/proxy.cpp
index e9ca531..03e382d 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -310,7 +310,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
               td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                        td->buffer->getBuffer 
(),
-                                                       nbr, out, useChunks);
+                                                       nbr, *out, useChunks);
             }
         }
     }
@@ -340,7 +340,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
             length -= nbr;
 
           td->sentData += HttpDataHandler::appendDataToHTTPChannel (td, 
td->buffer->getBuffer (),
-                                                    nbr, out, useChunks);
+                                                    nbr, *out, useChunks);
           if (timedOut || contentLength && length == 0)
             break;
         }
diff --git a/myserver/src/http_handler/scgi/scgi.cpp 
b/myserver/src/http_handler/scgi/scgi.cpp
index 1158582..a7d1e06 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -268,7 +268,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, 
FiltersChain* chain)
   if (read - headerSize)
     td->sentData +=
       appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + 
headerSize,
-                             read - headerSize, chain, useChunks);
+                             read - headerSize, *chain, useChunks);
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
     {
@@ -283,7 +283,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, 
FiltersChain* chain)
 
           td->sentData +=
             appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                     nbr, chain, useChunks);
+                                     nbr, *chain, useChunks);
         }
 
       if (useChunks)
diff --git a/myserver/src/protocol/http/http_data_handler.cpp 
b/myserver/src/protocol/http/http_data_handler.cpp
index 2bd5a8f..40c9245 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -21,6 +21,7 @@
 #include <include/protocol/http/http_headers.h>
 #include <include/protocol/http/http.h>
 #include <include/protocol/http/http_data_handler.h>
+#include <include/filter/filters_chain.h>
 
 /*!
   Send a file to the client using the HTTP protocol.
@@ -76,16 +77,16 @@ int HttpDataHandler::unLoad ()
 size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                                  const char *buffer,
                                                  size_t size,
-                                                 FiltersChain *chain,
+                                                 FiltersChain &chain,
                                                  bool useChunks,
                                                  size_t realBufferSize,
-                                                 MemoryStream *tmpStream)
+                                                 MemoryStream &tmpStream)
 {
   char tmpBuf[BUFSIZ];
   size_t nbr, nbw, written = 0, totalNbw = 0;
-  Stream *oldStream = chain->getStream ();
+  Stream *oldStream = chain.getStream ();
 
-  if (! chain->hasModifiersFilters () || size == 0)
+  if (! chain.hasModifiersFilters () || size == 0)
     return appendDataToHTTPChannel (td, buffer, size, chain, useChunks);
 
   /*
@@ -102,23 +103,23 @@ size_t HttpDataHandler::appendDataToHTTPChannel 
(HttpThreadContext *td,
         {
           if (size - written)
             {
-              chain->setStream (tmpStream);
-              chain->write (buffer + written, size - written, &nbw);
-              chain->setStream (oldStream);
+              chain.setStream (&tmpStream);
+              chain.write (buffer + written, size - written, &nbw);
+              chain.setStream (oldStream);
               written += size;
             }
 
-          tmpStream->read (tmpBuf, BUFSIZ, &nbr);
+          tmpStream.read (tmpBuf, BUFSIZ, &nbr);
           if (nbr)
-            totalNbw += appendDataToHTTPChannel (td, tmpBuf, nbr, 
&directStream,
+            totalNbw += appendDataToHTTPChannel (td, tmpBuf, nbr, directStream,
                                                  useChunks);
         }
-      while (size - written);
-
+      while (size - written || nbr);
+      tmpStream.refresh ();
     }
   catch (...)
     {
-      chain->setStream (oldStream);
+      chain.setStream (oldStream);
       throw;
     }
 
@@ -138,7 +139,7 @@ size_t
 HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                           const char *buffer,
                                           size_t size,
-                                          FiltersChain *chain,
+                                          FiltersChain &chain,
                                           bool useChunks)
 {
   size_t tmp, nbw = 0;
@@ -147,15 +148,15 @@ HttpDataHandler::appendDataToHTTPChannel 
(HttpThreadContext *td,
     {
       ostringstream chunkHeader;
       chunkHeader << hex << size << "\r\n";
-      chain->getStream ()->write (chunkHeader.str ().c_str (),
-                                  chunkHeader.str ().length (), &tmp);
+      chain.getStream ()->write (chunkHeader.str ().c_str (),
+                                 chunkHeader.str ().length (), &tmp);
     }
 
   if (size)
-    chain->write (buffer, size, &nbw);
+    chain.write (buffer, size, &nbw);
 
   if (useChunks)
-    chain->getStream ()->write ("\r\n", 2, &tmp);
+    chain.getStream ()->write ("\r\n", 2, &tmp);
 
   return nbw;
 }
@@ -189,3 +190,75 @@ HttpDataHandler::checkDataChunks (HttpThreadContext* td, 
bool* keepalive,
       *useChunks = true;
     }
 }
+
+/*!
+  Begin a HTTP response.
+*/
+size_t
+HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
+                                    MemoryStream &memStream,
+                                    FiltersChain &chain,
+                                    bool useChunks)
+{
+  size_t ret = 0;
+  /*
+    Flush initial data.  This is data that filters could have added
+    and we have to send before the file itself, for example the gzip
+    filter add a header to file.
+  */
+  if (memStream.availableToRead ())
+    {
+      size_t nbr;
+      memStream.read (td->buffer->getBuffer (),
+                      td->buffer->getRealLength (), &nbr);
+
+      memStream.refresh ();
+      if (nbr)
+        {
+          FiltersChain directChain (chain.getStream ());
+          ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (), nbr,
+                                          directChain, useChunks);
+        }
+    }
+
+  return ret;
+}
+
+/*!
+  Complete a HTTP response.
+ */
+size_t
+HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
+                                       MemoryStream &memStream,
+                                       FiltersChain &chain,
+                                       bool useChunks)
+{
+  size_t ret = 0;
+  /* If we don't use chunks we can flush directly.  */
+  if (! useChunks)
+    chain.flush (&ret);
+  else
+    {
+      /*
+        Replace the final stream before the flush and write to a
+        memory buffer, after all the data is flushed from the
+        chain we can replace the stream with the original one and
+        write there the HTTP data chunk.
+      */
+      size_t nbr, nbw;
+      Stream* tmpStream = chain.getStream ();
+      FiltersChain directChain (tmpStream);
+      memStream.refresh ();
+      chain.setStream (&memStream);
+      chain.flush (&nbw);
+      chain.setStream (tmpStream);
+      memStream.read (td->buffer->getBuffer (),
+                      td->buffer->getRealLength (), &nbr);
+
+      ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                      nbr, directChain, useChunks);
+      chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+    }
+
+  return ret;
+}
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp 
b/myserver/src/protocol/http/webdav/webdav.cpp
index b15b801..dbacd61 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -337,7 +337,7 @@ int WebDAV::propfind (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, 
td->buffer->getBuffer (),
-                                                      nbr, &chain, useChunks);
+                                                      nbr, chain, useChunks);
           if (nbr != td->buffer->getRealLength ())
             break;
         }
@@ -654,7 +654,7 @@ int WebDAV::lock (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, 
td->buffer->getBuffer (),
-                                                      nbr, &chain, useChunks);
+                                                      nbr, chain, useChunks);
         }
 
       if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))



commit 5110fad6ca5ec2a6bbaa1aa63df54e348449e055
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Apr 22 12:25:36 2011 +0200

    ClientsThread: code cleanup

diff --git a/myserver/src/server/clients_thread.cpp 
b/myserver/src/server/clients_thread.cpp
index 28018bd..073bd90 100644
--- a/myserver/src/server/clients_thread.cpp
+++ b/myserver/src/server/clients_thread.cpp
@@ -261,7 +261,8 @@ int ClientsThread::controlConnections ()
 
   if (! c->isForceControl ())
     {
-      err = c->socket->recv (&((char*)(buffer.getBuffer ()))[dataRead],
+      int available = c->socket->dataAvailable ();
+      err = c->socket->recv (buffer.getBuffer () + dataRead,
                              MYSERVER_KB (8) - dataRead - 1, 0);
 
       if (err <= 0)
@@ -278,7 +279,7 @@ int ClientsThread::controlConnections ()
   nBytesToRead = dataRead + err;
 
   if ((dataRead + err) < MYSERVER_KB (8))
-    ((char*)buffer.getBuffer ())[dataRead + err] = '\0';
+    (buffer.getBuffer ())[dataRead + err] = '\0';
   else
     {
       server->deleteConnection (c);
@@ -289,8 +290,8 @@ int ClientsThread::controlConnections ()
     c->setnTries (0);
 
   if (dataRead)
-    memcpy ((char*) buffer.getBuffer (),
-            c->getConnectionBuffer ()->getBuffer (), dataRead);
+    memcpy (buffer.getBuffer (), c->getConnectionBuffer ()->getBuffer (),
+            dataRead);
 
   c->setActiveThread (this);
   try



commit 4b94a0f7b4e15c29b867a60cc4787b67f3d7dc17
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Apr 22 12:25:26 2011 +0200

    HttpFile: use the whole buffer with modifiers buffer.

diff --git a/myserver/src/http_handler/http_file/http_file.cpp 
b/myserver/src/http_handler/http_file/http_file.cpp
index 494d20c..72e2e9e 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -457,9 +457,6 @@ int HttpFile::send (HttpThreadContext* td, const char 
*filenamePath,
             /* Read from the file the bytes to send.  */
             size_t size = std::min (td->buffer->getRealLength (), bytesToSend);
 
-            if (useModifiers)
-              size = std::min (size, td->auxiliaryBuffer->getRealLength () / 
2);
-
             file->read (td->buffer->getBuffer (), size, &nbr);
             if (nbr == 0)
               {



commit dbee1d8ee189c245a878a4ac7a7e7516372acc89
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Apr 22 12:24:42 2011 +0200

    SslSocket: send data ordered correctly

diff --git a/myserver/src/base/socket/ssl_socket.cpp 
b/myserver/src/base/socket/ssl_socket.cpp
index 69a0082..a232880 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -122,7 +122,7 @@ int SslSocket::rawSend (const char* buffer, int len, int 
flags)
   int ret;
   do
     {
-      ret = gnutls_record_send (session, buffer, len);
+      ret = gnutls_record_send (session, buffer + sent, len - sent);
       if (ret > 0)
         sent += ret;
     }
@@ -246,16 +246,11 @@ int SslSocket::recv (char* buffer, int len, int flags)
 {
   int ret = 0;
 
-  for (;;)
+  do
     {
-      do
-        {
-          ret = gnutls_record_recv (session, buffer, len);
-        }
-      while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
-      if (ret > 0)
-        break;
+      ret = gnutls_record_recv (session, buffer, len);
     }
+  while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
 
   if (ret < 0)
     throw SslException (ret);

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

Summary of changes:
 myserver/include/protocol/http/http_data_handler.h |   16 +++-
 myserver/src/base/socket/ssl_socket.cpp            |   13 +--
 myserver/src/http_handler/cgi/cgi.cpp              |    4 +-
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |    4 +-
 myserver/src/http_handler/http_dir/http_dir.cpp    |   12 +-
 myserver/src/http_handler/http_file/http_file.cpp  |   66 ++-----------
 myserver/src/http_handler/mscgi/mscgi.cpp          |    4 +-
 myserver/src/http_handler/proxy/proxy.cpp          |    4 +-
 myserver/src/http_handler/scgi/scgi.cpp            |    4 +-
 myserver/src/protocol/http/http_data_handler.cpp   |  107 ++++++++++++++++---
 myserver/src/protocol/http/webdav/webdav.cpp       |    4 +-
 myserver/src/server/clients_thread.cpp             |    9 +-
 12 files changed, 139 insertions(+), 108 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

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