webserver.c: added "-t" option to send traces somewhere else
authorArt Cancro <ajc@citadel.org>
Sat, 8 May 1999 05:07:33 +0000 (05:07 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 8 May 1999 05:07:33 +0000 (05:07 +0000)
webcit/ChangeLog
webcit/context_loop.c
webcit/webserver.c

index ff4d9cb8c0b65c0e468cab8d3f0240caabf9e9db..fcf761af5b378fd02545b1ad2eee1d3659c7358d 100644 (file)
@@ -1,3 +1,6 @@
+Sat May  8 01:07:06 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * webserver.c: added "-t" option to send traces somewhere else
+
 Tue Apr 27 23:36:35 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * context_loop.c: display an error page if the client browser
          requests a non-root page and there is no cookie set
index b7e9ab3fee71bb356b776cc3bb6e09974c1c5581..6128100ad233bc0c7da261011e925789a2365e96 100644 (file)
@@ -434,7 +434,7 @@ void *context_loop(int sock)
        } else {
 end:           unlock_session(TheSession);
        }
-end2:  free(req);
+       free(req);
 
 
        /*
index 0e5d303bf7e0eda14c51e15dae5bc28fee9658eb..900ff3020cb938bf51d17275e91f2a570aaee61c 100644 (file)
@@ -237,15 +237,23 @@ int main(int argc, char **argv)
        pthread_attr_t attr;    /* Thread attributes */
        int a, i;               /* General-purpose variables */
        int port = PORT_NUM;    /* Port to listen on */
+       char tracefile[PATH_MAX];
 
        /* Parse command line */
-       while ((a = getopt(argc, argv, "hp:")) != EOF)
+       while ((a = getopt(argc, argv, "hp:t:")) != EOF)
                switch (a) {
                case 'p':
                        port = atoi(optarg);
                        break;
+               case 't':
+                       strcpy(tracefile, optarg);
+                       freopen(tracefile, "w", stdout);
+                       freopen(tracefile, "w", stderr);
+                       freopen(tracefile, "r", stdin);
+                       break;
                default:
                        fprintf(stderr, "usage: webserver [-p localport] "
+                               "[-t tracefile] "
                                "[remotehost [remoteport]]\n");
                        return 1;
                }