int verbosity = 9; /* Logging level */
int msock; /* master listening socket */
int is_https = 0; /* Nonzero if I am an HTTPS service */
+int follow_xff = 0; /* Follow X-Forwarded-For: header */
extern void *context_loop(int);
extern void *housekeeping_loop(void);
extern pthread_mutex_t SessionListMutex;
char tracefile[PATH_MAX];
char ip_addr[256];
char *webcitdir = WEBCITDIR;
- char *locale = NULL;
-
- /* initialize the International Bright Young Thing */
#ifdef ENABLE_NLS
- locale = setlocale(LC_ALL, "");
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
-#endif
+ char *locale = NULL;
+ char *mo = NULL;
+#endif /* ENABLE_NLS */
/* Parse command line */
#ifdef HAVE_OPENSSL
- while ((a = getopt(argc, argv, "h:i:p:t:x:cs")) != EOF)
+ while ((a = getopt(argc, argv, "h:i:p:t:x:cfs")) != EOF)
#else
- while ((a = getopt(argc, argv, "h:i:p:t:x:c")) != EOF)
+ while ((a = getopt(argc, argv, "h:i:p:t:x:cf")) != EOF)
#endif
switch (a) {
case 'h':
case 'x':
verbosity = atoi(optarg);
break;
+ case 'f':
+ follow_xff = 1;
+ break;
case 'c':
server_cookie = malloc(256);
if (server_cookie != NULL) {
default:
fprintf(stderr, "usage: webserver "
"[-i ip_addr] [-p http_port] "
- "[-t tracefile] [-c] "
+ "[-t tracefile] [-c] [-f] "
#ifdef HAVE_OPENSSL
"[-s] "
#endif
perror("chdir");
}
+ /* initialize the International Bright Young Thing */
+#ifdef ENABLE_NLS
+
+ initialize_locales();
+
+ locale = setlocale(LC_ALL, "");
+
+ mo = malloc(strlen(webcitdir) + 20);
+ sprintf(mo, "%s/locale", webcitdir);
+ lprintf(9, "Message catalog directory: %s\n",
+ bindtextdomain("webcit", mo)
+ );
+ free(mo);
+ lprintf(9, "Text domain: %s\n",
+ textdomain("webcit")
+ );
+ lprintf(9, "Text domain Charset: %s\n",
+ bind_textdomain_codeset("webcit","UTF8")
+ );
+#endif
+
+ initialize_viewdefs();
+ initialize_axdefs();
+
/*
* Set up a place to put thread-specific data.
* We only need a single pointer per thread - it points to the