+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
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;
}