]> code.citadel.org Git - citadel.git/blobdiff - webcit/netconf.c
* Rewrote the HTTP engine and application coupling to run in a worker thread
[citadel.git] / webcit / netconf.c
index 7fa7ae602231596b96a1f155f1c2158cac97f842..6b2d763cdfc960fdd5ba22bc10f60d1a1bbe36c9 100644 (file)
@@ -1,12 +1,31 @@
+
+
+
+#include <ctype.h>
 #include <stdlib.h>
 #include <unistd.h>
 #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"
+
+
+
+
+
 
 struct sharelist {
        struct sharelist *next;
@@ -22,8 +41,8 @@ void display_edit_node(void)
 
        strcpy(node, bstr("node"));
 
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1, "bottom");
+       wprintf("HTTP/1.0 200 OK\n");
+       output_headers(1);
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Edit share list for ");
@@ -67,8 +86,8 @@ void display_netconf(void)
        char buf[256];
        char node[256];
 
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1, "bottom");
+       wprintf("HTTP/1.0 200 OK\n");
+       output_headers(1);
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Network configuration</B>\n");
@@ -111,8 +130,8 @@ void display_confirm_unshare(void)
        char node[256];
        char sroom[256];
 
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1, "bottom");
+       wprintf("HTTP/1.0 200 OK\n");
+       output_headers(1);
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Confirm unshare</B>\n");
@@ -139,8 +158,8 @@ void display_confirm_delete_node(void)
 {
        char node[256];
 
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1, "bottom");
+       wprintf("HTTP/1.0 200 OK\n");
+       output_headers(1);
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Confirm delete</B>\n");
@@ -168,8 +187,8 @@ void delete_node(void)
        serv_puts(buf);
        serv_gets(buf);
        if (buf[0] == '1') {
-               printf("HTTP/1.0 200 OK\n");
-               output_headers(1, "bottom");
+               wprintf("HTTP/1.0 200 OK\n");
+               output_headers(1);
                server_to_text();
                wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
                wDumpContent(1);
@@ -191,8 +210,8 @@ void unshare(void)
        serv_puts(buf);
        serv_gets(buf);
        if (buf[0] == '1') {
-               printf("HTTP/1.0 200 OK\n");
-               output_headers(1, "bottom");
+               wprintf("HTTP/1.0 200 OK\n");
+               output_headers(1);
                server_to_text();
                wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
                wDumpContent(1);
@@ -206,8 +225,8 @@ void unshare(void)
 void display_add_node(void)
 {
 
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1, "bottom");
+       wprintf("HTTP/1.0 200 OK\n");
+       output_headers(1);
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Add a new node</B>\n");
@@ -242,8 +261,8 @@ void add_node(void)
                serv_puts(buf);
                serv_gets(buf);
                if (buf[0] == '1') {
-                       printf("HTTP/1.0 200 OK\n");
-                       output_headers(1, "bottom");
+                       wprintf("HTTP/1.0 200 OK\n");
+                       output_headers(1);
                        server_to_text();
                        wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
                        wDumpContent(1);
@@ -266,8 +285,8 @@ void display_share(void)
 
        strcpy(node, bstr("node"));
 
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1, "bottom");
+       wprintf("HTTP/1.0 200 OK\n");
+       output_headers(1);
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Add a shared room</B>\n");
@@ -346,8 +365,8 @@ void share(void)
                serv_puts(buf);
                serv_gets(buf);
                if (buf[0] == '1') {
-                       printf("HTTP/1.0 200 OK\n");
-                       output_headers(1, "bottom");
+                       wprintf("HTTP/1.0 200 OK\n");
+                       output_headers(1);
                        server_to_text();
                        wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
                        wDumpContent(1);