]> code.citadel.org Git - citadel.git/blobdiff - webcit/webserver.c
* crypto.c: keys/ directory is relative to the directory from which WebCit
[citadel.git] / webcit / webserver.c
index 27f6c91a2248183ce6d97e3a76e11f567a031fc8..16dbef92438aa9eae7c8d3d3ebf4f6a0d3275edb 100644 (file)
@@ -7,10 +7,6 @@
  *
  */
 
-/*
- * Uncomment to dump an HTTP trace to stderr
- */
-#define HTTP_TRACING 1
 
 #include <ctype.h>
 #include <stdlib.h>
@@ -275,7 +271,6 @@ void end_burst(void)
        WC->burst_len = 0;
        WC->burst = NULL;
 
-#ifndef HTTP_TRACING
 #ifdef HAVE_ZLIB
        /* Handle gzip compression */
        if (WC->gzip_ok) {
@@ -298,7 +293,6 @@ void end_burst(void)
                }
        }
 #endif                         /* HAVE_ZLIB */
-#endif                         /*  HTTP_TRACING */
 
        wprintf("Content-length: %d\r\n\r\n", the_len);
        client_write(the_data, the_len);
@@ -414,14 +408,18 @@ int main(int argc, char **argv)
        int port = PORT_NUM;    /* Port to listen on */
        char tracefile[PATH_MAX];
        char ip_addr[256];
+       char *webcitdir = WEBCITDIR;
 
        /* Parse command line */
 #ifdef HAVE_OPENSSL
-       while ((a = getopt(argc, argv, "hi:p:t:x:cs")) != EOF)
+       while ((a = getopt(argc, argv, "h:i:p:t:x:cs")) != EOF)
 #else
-       while ((a = getopt(argc, argv, "hi:p:t:x:c")) != EOF)
+       while ((a = getopt(argc, argv, "h:i:p:t:x:c")) != EOF)
 #endif
                switch (a) {
+               case 'h':
+                       webcitdir = strdup(optarg);
+                       break;
                case 'i':
                        safestrncpy(ip_addr, optarg, sizeof ip_addr);
                        break;
@@ -473,12 +471,15 @@ int main(int argc, char **argv)
        }
        /* Tell 'em who's in da house */
        lprintf(1, SERVER "\n"
-               "Copyright (C) 1996-2005 by the Citadel/UX development team.\n"
-               "This software is distributed under the terms of the GNU General Public\n"
-               "License.  If you paid for this software, someone is ripping you off.\n\n");
+               "Copyright (C) 1996-2005 by the Citadel development team.\n"
+               "This software is distributed under the terms of the "
+               "GNU General Public License.\n\n"
+       );
 
-       if (chdir(WEBCITDIR) != 0)
+       lprintf(9, "Changing directory to %s\n", webcitdir);
+       if (chdir(webcitdir) != 0) {
                perror("chdir");
+       }
 
        /*
         * Set up a place to put thread-specific data.