]> code.citadel.org Git - citadel.git/blobdiff - webcit/webserver.c
* move templates to static/t/ ; made make install target respect this
[citadel.git] / webcit / webserver.c
index 56a34eb063d819be8435bedf38d7165f461987c8..6a0c80abf7a0fadcccb3d2c61840aed4265bbf42 100644 (file)
@@ -242,7 +242,8 @@ int client_read_to(int sock, char *buf, int bytes, int timeout)
  */
 void begin_burst(void)
 {
-       WC->WBuf = NewStrBufPlain(NULL, 32768);
+       if (WC->WBuf == NULL)
+               WC->WBuf = NewStrBufPlain(NULL, 32768);
 }
 
 
@@ -586,6 +587,7 @@ void spawn_another_worker_thread()
 const char foobuf[32];
 const char *nix(void *vptr) {snprintf(foobuf, 32, "%0x", (long) vptr); return foobuf;}
 #endif 
+void InitTemplateCache(void);
 
 /*
  * \brief Here's where it all begins.
@@ -615,6 +617,13 @@ int main(int argc, char **argv)
        char uds_listen_path[PATH_MAX]; /*< listen on a unix domain socket? */
 
        HandlerHash = NewHash(1, NULL);
+       PreferenceHooks = NewHash(1, NULL);
+       WirelessTemplateCache = NewHash(1, NULL);
+       WirelessLocalTemplateCache = NewHash(1, NULL);
+       TemplateCache = NewHash(1, NULL);
+       LocalTemplateCache = NewHash(1, NULL);
+       InitTemplateCache();
+
        initialise_modules();
 
 #ifdef DBG_PRINNT_HOOKS_AT_START
@@ -859,6 +868,7 @@ int main(int argc, char **argv)
        worker_entry();
        ShutDownLibCitadel ();
        DeleteHash(&HandlerHash);
+       DeleteHash(&PreferenceHooks);
        return 0;
 }
 
@@ -934,6 +944,11 @@ void worker_entry(void)
                                icaltimezone_release_zone_tab ();
                                icalmemory_free_ring ();
                                ShutDownLibCitadel ();
+                               DeleteHash(&HandlerHash);
+                               DeleteHash(&PreferenceHooks);
+#ifdef ENABLE_NLS
+                               void ShutdownLocale(void);
+#endif
                                lprintf(2, "master shutdown exiting!.\n");                              
                                exit(0);
                        }