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. 8ae99cac68


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 8ae99cac68bbc1b1f7af9ae61161c09515c596a8
Date: Sun, 25 Oct 2009 12:32:16 +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  8ae99cac68bbc1b1f7af9ae61161c09515c596a8 (commit)
       via  5bc4048c6058f9d545f134d01d3f813b488f791e (commit)
      from  250823e4ae035f0266a00fb45d44a6585714a574 (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 8ae99cac68bbc1b1f7af9ae61161c09515c596a8
Author: Giuseppe Scrivano <address@hidden>
Date:   Sun Oct 25 13:31:34 2009 +0100

    Specify bytes when the file length is zero.

diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp 
b/myserver/src/http_handler/http_dir/http_dir.cpp
index dfc046a..f597f2b 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -141,17 +141,17 @@ void HttpDir::getFormattedSize (u_long bytes, string & 
out)
   ostringstream osstr;
 
   if (bytes == 0)
-  {
-    out = "0";
-    return;
-  }
+    {
+      out = "0 bytes";
+      return;
+    }
 
   for (i = 0; i < sizeof (powers); i++)
-  {
-    result = formatBytes (bytes, powers[i]);
-    if (result != -1)
-      break;
-  }
+    {
+      result = formatBytes (bytes, powers[i]);
+      if (result != -1)
+        break;
+    }
 
   if ((result - floor (result)) < 0.01)
     osstr << std::fixed << setprecision (0) << result << " " << symbols[i];
@@ -261,15 +261,13 @@ void HttpDir::generateElement (MemBuf &out,
     case 's':
       out << "<td>";
       if (file.attrib & FILE_ATTRIBUTE_DIRECTORY)
-      {
         out << "[directory]";
-      }
       else
-      {
-        string tmp;
-        getFormattedSize (file.size, tmp);
-        out << tmp;
-      }
+        {
+          string tmp;
+          getFormattedSize (file.size, tmp);
+          out << tmp;
+        }
       out << "</td>";
       break;
     }



commit 5bc4048c6058f9d545f134d01d3f813b488f791e
Author: Giuseppe Scrivano <address@hidden>
Date:   Sun Oct 25 13:30:52 2009 +0100

    Be sure the attrib element is zero'ed before use it.

diff --git a/myserver/src/base/read_directory/read_directory.cpp 
b/myserver/src/base/read_directory/read_directory.cpp
index 0525000..5f58c1d 100644
--- a/myserver/src/base/read_directory/read_directory.cpp
+++ b/myserver/src/base/read_directory/read_directory.cpp
@@ -138,17 +138,16 @@ int ReadDirectory::find (const char *filename)
    if (fstatat (dirfd (dh), name.c_str (), &stats, 0))
      return -1;
 # else
-
-   string tempName = filename;
-
+   string tempName;
    tempName.assign (dirName);
    tempName.append ("/");
    tempName.append (dirInfo->d_name);
-
    if (stat (tempName.c_str (), &stats))
      return -1;
 # endif
 
+   attrib = 0;
+
    if (S_ISDIR (stats.st_mode))
      attrib = FILE_ATTRIBUTE_DIRECTORY;
 

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

Summary of changes:
 .../src/base/read_directory/read_directory.cpp     |    7 ++--
 myserver/src/http_handler/http_dir/http_dir.cpp    |   30 +++++++++----------
 2 files changed, 17 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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