int home_specified = 0; /* did the user specify a homedir? */
int time_to_die = 0; /* Nonzero if server is shutting down */
int DisableGzip = 0;
-extern void *context_loop(int*);
+extern void *context_loop(ParsedHttpHdrs *Hdr);
extern void *housekeeping_loop(void);
extern pthread_mutex_t SessionListMutex;
extern pthread_key_t MyConKey;
extern HashList *HandlerHash;
+
void
webcit_calc_dirs_n_files(int relh, const char *basedir, int home, char *webcitdir, char *relhome)
{
COMPUTE_DIRECTORY(static_icon_dir);
basedir=WWWDIR "/static.local";
COMPUTE_DIRECTORY(static_local_dir);
+ StripSlashes(static_dir, 1);
+ StripSlashes(static_icon_dir, 1);
+ StripSlashes(static_local_dir, 1);
snprintf(file_crpt_file_key,
sizeof file_crpt_file_key,
*/
int main(int argc, char **argv)
{
+ size_t basesize = 2; /* how big should strbufs be on creation? */
pthread_t SessThread; /* Thread descriptor */
pthread_attr_t attr; /* Thread attributes */
int a, i; /* General-purpose variables */
/* Parse command line */
#ifdef HAVE_OPENSSL
- while ((a = getopt(argc, argv, "h:i:p:t:T:x:dD:G:cfsZ")) != EOF)
+ while ((a = getopt(argc, argv, "h:i:p:t:T:B:x:dD:G:cfsZ")) != EOF)
#else
- while ((a = getopt(argc, argv, "h:i:p:t:T:x:dD:G:cfZ")) != EOF)
+ while ((a = getopt(argc, argv, "h:i:p:t:T:B:x:dD:G:cfZ")) != EOF)
#endif
switch (a) {
case 'h':
pidfile = strdup(optarg);
running_as_daemon = 1;
break;
+ case 'B': /* Basesize */
+ basesize = atoi(optarg);
+ if (basesize > 2)
+ StartLibCitadel(basesize);
+ break;
case 'i':
safestrncpy(ip_addr, optarg, sizeof ip_addr);
break;
lprintf(9, "Text domain Charset: %s\n", bind_textdomain_codeset("webcit","UTF8"));
#endif
-
-
-
-
-
-
-
-
-
initialise_modules();
initialize_viewdefs();
initialize_axdefs();
int ret;
struct timeval tv;
fd_set readset, tempset;
+ ParsedHttpHdrs Hdr;
+
+ memset(&Hdr, 0, sizeof(ParsedHttpHdrs));
+ Hdr.HR.eReqType = eGET;
tv.tv_sec = 0;
tv.tv_usec = 10000;
#endif
if (fail_this_transaction == 0) {
+ Hdr.http_sock = ssock;
/* Perform an HTTP transaction... */
- context_loop(&ssock);
+ context_loop(&Hdr);
/* Shut down SSL/TLS if required... */
#ifdef HAVE_OPENSSL
#endif
/* ...and close the socket. */
- if (ssock > 0)
+ if (Hdr.http_sock > 0)
lingering_close(ssock);
+ http_detach_modules(&Hdr);
+
}
}
} while (!time_to_die);
+ http_destroy_modules(&Hdr);
lprintf (1, "bye\n");
pthread_exit(NULL);
}