]> code.citadel.org Git - citadel.git/blobdiff - webcit/paging.c
* Moved all diagnostic output to stderr
[citadel.git] / webcit / paging.c
index 3fb54f9a7a13653664f62f70b7d14fa67b41afd2..553a872ff60b6d2a744bd3d8a3d6be692c3aa102 100644 (file)
@@ -1,16 +1,26 @@
 /* $Id$ */
 
+#include <ctype.h>
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <stdio.h>
+#include <fcntl.h>
 #include <signal.h>
 #include <sys/types.h>
-#include <ctype.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <limits.h>
+#include <netinet/in.h>
+#include <netdb.h>
 #include <string.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <pthread.h>
+#include <signal.h>
 #include "webcit.h"
-#include "child.h"
+
 
 /*
  * display the form for paging (x-messaging) another user
@@ -20,7 +30,6 @@ void display_page(void)
        char buf[256];
        char user[256];
 
-       printf("HTTP/1.0 200 OK\n");
        output_headers(1);
 
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
@@ -70,7 +79,6 @@ void page_user(void)
        char sc[256];
        char buf[256];
 
-       printf("HTTP/1.0 200 OK\n");
        output_headers(1);
 
        strcpy(recp, bstr("recp"));
@@ -79,19 +87,18 @@ void page_user(void)
 
        if (strcmp(sc, "Send message")) {
                wprintf("<EM>Message was not sent.</EM><BR>\n");
-               return;
-       }
-       serv_printf("SEXP %s|%s", recp, msgtext);
-       serv_gets(buf);
-
-       if (buf[0] == '2') {
-               wprintf("<EM>Message has been sent to ");
-               escputs(recp);
-               wprintf(".</EM><BR>\n");
        } else {
-               wprintf("<EM>%s</EM><BR>\n", &buf[4]);
+               serv_printf("SEXP %s|%s", recp, msgtext);
+               serv_gets(buf);
+
+               if (buf[0] == '2') {
+                       wprintf("<EM>Message has been sent to ");
+                       escputs(recp);
+                       wprintf(".</EM><BR>\n");
+               } else {
+                       wprintf("<EM>%s</EM><BR>\n", &buf[4]);
+               }
        }
-
        wDumpContent(1);
 }
 
@@ -103,7 +110,6 @@ void page_user(void)
 void do_chat(void)
 {
 
-       printf("HTTP/1.0 200 OK\n");
        output_headers(1);
 
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
@@ -118,8 +124,8 @@ void do_chat(void)
 
        wprintf("<applet codebase=\"/static\" ");
        wprintf("code=\"wcchat\" width=2 height=2>\n");
-       wprintf("<PARAM NAME=username VALUE=\"%s\">\n", wc_username);
-       wprintf("<PARAM NAME=password VALUE=\"%s\">\n", wc_password);
+       wprintf("<PARAM NAME=username VALUE=\"%s\">\n", WC->wc_username);
+       wprintf("<PARAM NAME=password VALUE=\"%s\">\n", WC->wc_password);
        wprintf("<H2>Oops!</H2>Looks like your browser doesn't support Java, ");
        wprintf("so you won't be able to access Chat.  Sorry.\n");
        wprintf("</applet>\n");