*/
void begin_burst(void)
{
- WC->WBuf = NewStrBufPlain(NULL, 32768);
+ if (WC->WBuf == NULL)
+ WC->WBuf = NewStrBufPlain(NULL, 32768);
}
#ifdef HAVE_OPENSSL
if (is_https) {
- client_write_ssl(ptr, StrLength(WCC->HBuf));
+ client_write_ssl(WCC->HBuf);
+ client_write_ssl(WCC->WBuf);
return (count);
}
#endif
#endif
fdflags = fcntl(WC->http_sock, F_GETFL);
- while (ptr < eptr) {
+ while (ptr < eptr) {
if ((fdflags & O_NONBLOCK) == O_NONBLOCK) {
FD_ZERO(&wset);
FD_SET(WCC->http_sock, &wset);
count = StrLength(WCC->WBuf);
eptr = ptr + count;
-#ifdef HAVE_OPENSSL
- if (is_https) {
- client_write_ssl(ptr, StrLength(WCC->HBuf));
- return (count);
- }
-#endif
-
#ifdef HTTP_TRACING
write(2, "\033[34m", 5);
const char foobuf[32];
const char *nix(void *vptr) {snprintf(foobuf, 32, "%0x", (long) vptr); return foobuf;}
#endif
+void InitTemplateCache(void);
+extern void LoadZoneFiles(void);
/*
* \brief Here's where it all begins.
* \param argc number of commandline args
char uds_listen_path[PATH_MAX]; /*< listen on a unix domain socket? */
HandlerHash = NewHash(1, NULL);
- initialise_modules();
+ PreferenceHooks = NewHash(1, NULL);
+ WirelessTemplateCache = NewHash(1, NULL);
+ WirelessLocalTemplateCache = NewHash(1, NULL);
+ LocalTemplateCache = NewHash(1, NULL);
+ TemplateCache = NewHash(1, NULL);
+ GlobalNS = NewHash(1, NULL);
+ Iterators = NewHash(1, NULL);
+ Contitionals = NewHash(1, NULL);
+ LoadZoneFiles();
+
#ifdef DBG_PRINNT_HOOKS_AT_START
dbg_PrintHash(HandlerHash, nix, NULL);
perror("chdir");
}
LoadIconDir(static_icon_dir);
+ InitTemplateCache();
+
+ initialise_modules();
initialize_viewdefs();
initialize_axdefs();
worker_entry();
ShutDownLibCitadel ();
DeleteHash(&HandlerHash);
+ DeleteHash(&PreferenceHooks);
return 0;
}
+void ShutDownWebcit(void)
+{
+ DeleteHash(&ZoneHash);
+ free_zone_directory ();
+ icaltimezone_release_zone_tab ();
+ icalmemory_free_ring ();
+ ShutDownLibCitadel ();
+ DeleteHash(&HandlerHash);
+ DeleteHash(&PreferenceHooks);
+ DeleteHash(&GlobalNS);
+ DeleteHash(&WirelessTemplateCache);
+ DeleteHash(&WirelessLocalTemplateCache);
+ DeleteHash(&TemplateCache);
+ DeleteHash(&LocalTemplateCache);
+ DeleteHash(&Iterators);
+ DeleteHash(&Contitionals);
+#ifdef ENABLE_NLS
+ ShutdownLocale();
+#endif
+}
+
/*
* Entry point for worker threads
*/
lprintf(2, "master shutdown: cleaning up sessions\n");
do_housekeeping();
lprintf(2, "master shutdown: cleaning up libical\n");
- free_zone_directory ();
- icaltimezone_release_zone_tab ();
- icalmemory_free_ring ();
- ShutDownLibCitadel ();
+
+ ShutDownWebcit();
+
lprintf(2, "master shutdown exiting!.\n");
exit(0);
}