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-345


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-345-gedd637b
Date: Sat, 21 Aug 2010 18:38:39 +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  edd637be98e01545ef469f0e55499414b71fb9b9 (commit)
      from  93a4d9b00be9a052eb1ee9158f1c83670584ee24 (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 edd637be98e01545ef469f0e55499414b71fb9b9
Author: Giuseppe Scrivano <address@hidden>
Date:   Sat Aug 21 20:34:20 2010 +0200

    Cache stat result.

diff --git a/myserver/include/base/file/file.h 
b/myserver/include/base/file/file.h
index ca614e7..faa5128 100644
--- a/myserver/include/base/file/file.h
+++ b/myserver/include/base/file/file.h
@@ -43,7 +43,8 @@ public:
       OPEN_IF_EXISTS = (1 << 6),
       APPEND = (1 << 7),
       NO_INHERIT = (1 << 8),
-      NO_FOLLOW_SYMLINK = (1 << 9)
+      NO_FOLLOW_SYMLINK = (1 << 9),
+      NO_CACHE_STAT = (1 << 10)
     };
 
   File ();
@@ -94,5 +95,7 @@ protected:
   u_long opt;
   FileHandle handle;
   string filename;
+
+  struct stat statS;
 };
 #endif
diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index f103d14..d632c04 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -180,6 +180,9 @@ int File::openFile (const char* nfilename, u_long opt, 
mode_t mask)
         }
     }
 
+  if (! (opt & NO_CACHE_STAT))
+    fstat (&statS);
+
   this->opt = opt;
   return handle < 0;
 }
@@ -272,11 +275,10 @@ int File::close ()
  */
 off_t File::getFileSize ()
 {
-  struct stat fStats;
-
-  checked::fstat (handle, &fStats);
+  if (opt & NO_CACHE_STAT)
+    checked::fstat (handle, &statS);
 
-  return fStats.st_size;
+  return statS.st_size;
 }
 
 /*!

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

Summary of changes:
 myserver/include/base/file/file.h |    5 ++++-
 myserver/src/base/file/file.cpp   |   10 ++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

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