myserver-commit
[Top][All Lists]
Advanced

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

[myserver-commit] [2795] Don't reload HTTP static errors message if they


From: Giuseppe Scrivano
Subject: [myserver-commit] [2795] Don't reload HTTP static errors message if they were already loaded
Date: Tue, 09 Sep 2008 20:57:38 +0000

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

Log Message:
-----------
Don't reload HTTP static errors message if they were already loaded

Modified Paths:
--------------
    trunk/myserver/include/protocol/http/http_errors.h
    trunk/myserver/src/protocol/http/http.cpp
    trunk/myserver/src/protocol/http/http_errors.cpp

Modified: trunk/myserver/include/protocol/http/http_errors.h
===================================================================
--- trunk/myserver/include/protocol/http/http_errors.h  2008-09-09 16:40:10 UTC 
(rev 2794)
+++ trunk/myserver/include/protocol/http/http_errors.h  2008-09-09 20:57:37 UTC 
(rev 2795)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
@@ -33,6 +33,7 @@
        static void load();
        static void unLoad();
 private:
+  static bool loaded;
        static void putMessage(int, const char*);
        static Mutex mutex;
        static HashMap<int, const char*> messagesMap;

Modified: trunk/myserver/src/protocol/http/http.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http.cpp   2008-09-09 16:40:10 UTC (rev 
2794)
+++ trunk/myserver/src/protocol/http/http.cpp   2008-09-09 20:57:37 UTC (rev 
2795)
@@ -2378,6 +2378,7 @@
   staticHttp.browseDirCSSpath.assign("");
 
   Server::getInstance()->setGlobalData("http-static", getStaticData());
+
   /* Load the HTTP errors.  */
   HttpErrors::load();
 

Modified: trunk/myserver/src/protocol/http/http_errors.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http_errors.cpp    2008-09-09 16:40:10 UTC 
(rev 2794)
+++ trunk/myserver/src/protocol/http/http_errors.cpp    2008-09-09 20:57:37 UTC 
(rev 2795)
@@ -25,6 +25,9 @@
 Mutex HttpErrors::mutex;
 HashMap<int, const char*> HttpErrors::messagesMap;
 
+bool HttpErrors::loaded = false;
+
+
 /*!
  *Get an error page from its error code.
  *\param statusCode The HTTP error.
@@ -79,7 +82,11 @@
  */
 void HttpErrors::load()
 {
+  if(loaded)
+    return;
 
+  loaded = true;
+
   /* INFORMATIONAL.  */
   putMessage(100, "Continue");  
   putMessage(101, "Switching Protocols");






reply via email to

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