* Remove the defaulthost/defaultport vs. c_host/c_port stuff -- we haven't
authorArt Cancro <ajc@citadel.org>
Wed, 9 Apr 2003 04:02:32 +0000 (04:02 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 9 Apr 2003 04:02:32 +0000 (04:02 +0000)
  supported the idea of one WebCit connecting to multiple Citadels for a
  long time.  Now it's just one set of variables, called ctdlhost/ctdlport.
* When connecting to Citadel through a Unix domain socket, don't try to make
  the Java chat applet available.

webcit/ChangeLog
webcit/paging.c
webcit/webcit.c
webcit/webcit.h
webcit/webserver.c

index 7b444f264323442ef26eedbdb83a7ba656716abd..9d728b98a421e33bb2784bcfb8fb911497465315 100644 (file)
@@ -1,4 +1,11 @@
 $Log$
+Revision 410.9  2003/04/09 04:02:32  ajc
+* Remove the defaulthost/defaultport vs. c_host/c_port stuff -- we haven't
+  supported the idea of one WebCit connecting to multiple Citadels for a
+  long time.  Now it's just one set of variables, called ctdlhost/ctdlport.
+* When connecting to Citadel through a Unix domain socket, don't try to make
+  the Java chat applet available.
+
 Revision 410.8  2003/03/31 03:32:19  ajc
 * messages.c: check for 000 terminator while parsing RFC822 headers to
   prevent getting hung up while displaying certain badly formatted messages.
@@ -1316,3 +1323,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index a3987058e13493f1e8563f78c9b28bab669bcc57..adca9fbac2f216fa0ad2dc5786a0cd1f0a9bbcbb 100644 (file)
@@ -125,19 +125,24 @@ void do_chat(void)
        wprintf("<B>Real-time chat</B>\n");
        wprintf("</FONT></TD></TR></TABLE>\n");
 
-       wprintf("A chat window should be appearing on your screen ");
-       wprintf("momentarily.  When you're ");
-       wprintf("done, type <TT>/quit</TT> to exit.  You can also ");
-       wprintf("type <TT>/help</TT> for more commands.\n");
-
-       wprintf("<applet codebase=\"/static\" ");
-       wprintf("code=\"wcchat\" width=2 height=2>\n");
-       wprintf("<PARAM NAME=username VALUE=\"%s\">\n", WC->wc_username);
-       wprintf("<PARAM NAME=password VALUE=\"%s\">\n", WC->wc_password);
-       wprintf("<PARAM NAME=roomname VALUE=\"%s\">\n", WC->wc_roomname);
-       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");
+       if (!strcasecmp(ctdlhost, "uds")) {
+               wprintf("<I>Sorry ... chat is not available here.</i></BR>\n");
+       }
+       else {
+               wprintf("A chat window should be appearing on your screen ");
+               wprintf("momentarily.  When you're ");
+               wprintf("done, type <TT>/quit</TT> to exit.  You can also ");
+               wprintf("type <TT>/help</TT> for more commands.\n");
+       
+               wprintf("<applet codebase=\"/static\" ");
+               wprintf("code=\"wcchat\" width=2 height=2>\n");
+               wprintf("<PARAM NAME=username VALUE=\"%s\">\n", WC->wc_username);
+               wprintf("<PARAM NAME=password VALUE=\"%s\">\n", WC->wc_password);
+               wprintf("<PARAM NAME=roomname VALUE=\"%s\">\n", WC->wc_roomname);
+               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");
+       }
        wDumpContent(1);
 }
 
index 30510ff5415ea4269111e9f9f46acab504c1e037..1794832ab71c0a382683fdbea7562a63ec506c7d 100644 (file)
@@ -730,15 +730,11 @@ void session_loop(struct httprequest *req)
        /* We stuff these with the values coming from the client cookies,
         * so we can use them to reconnect a timed out session if we have to.
         */
-       char c_host[SIZ];
-       char c_port[SIZ];
        char c_username[SIZ];
        char c_password[SIZ];
        char c_roomname[SIZ];
        char cookie[SIZ];
 
-       strcpy(c_host, defaulthost);
-       strcpy(c_port, defaultport);
        strcpy(c_username, "");
        strcpy(c_password, "");
        strcpy(c_roomname, "");
@@ -825,23 +821,17 @@ void session_loop(struct httprequest *req)
 
        /*
         * If we're not connected to a Citadel server, try to hook up the
-        * connection now.  Preference is given to the host and port specified
-        * by browser cookies, if cookies have been supplied.
+        * connection now.
         */
        if (!WC->connected) {
-               if (strlen(bstr("host")) > 0)
-                       strcpy(c_host, bstr("host"));
-               if (strlen(bstr("port")) > 0)
-                       strcpy(c_port, bstr("port"));
-
-               if (!strcasecmp(c_host, "uds")) {
+               if (!strcasecmp(ctdlhost, "uds")) {
                        /* unix domain socket */
-                       sprintf(buf, "%s/citadel.socket", c_port);
+                       sprintf(buf, "%s/citadel.socket", ctdlport);
                        WC->serv_sock = uds_connectsock(buf);
                }
                else {
                        /* tcp socket */
-                       WC->serv_sock = tcp_connectsock(c_host, c_port);
+                       WC->serv_sock = tcp_connectsock(ctdlhost, ctdlport);
                }
 
                if (WC->serv_sock < 0) {
index 550566bd19014585a7ebf8dfe55ca837abc3fad8..dc480e36990c3d62f188aeda4e26ba9801f0be10 100644 (file)
@@ -202,7 +202,7 @@ extern pthread_key_t MyConKey;
 struct serv_info serv_info;
 extern char floorlist[128][SIZ];
 extern char *axdefs[];
-extern char *defaulthost, *defaultport;
+extern char *ctdlhost, *ctdlport;
 extern char *server_cookie;
 
 extern struct wcsubst *global_subst;
index c15846c613bf97b2f7164da5f1c8b674e1c7c768..7924feaeb0809ba36986277cfaee8086a2837ba5 100644 (file)
@@ -54,8 +54,8 @@ extern pthread_key_t MyConKey;
 char *server_cookie = NULL;
 
 
-char *defaulthost = DEFAULT_HOST;
-char *defaultport = DEFAULT_PORT;
+char *ctdlhost = DEFAULT_HOST;
+char *ctdlport = DEFAULT_PORT;
 
 /*
  * This is a generic function to set up a master socket for listening on
@@ -263,9 +263,9 @@ int main(int argc, char **argv)
                }
 
        if (optind < argc) {
-               defaulthost = argv[optind];
+               ctdlhost = argv[optind];
                if (++optind < argc)
-                       defaultport = argv[optind];
+                       ctdlport = argv[optind];
        }
        /* Tell 'em who's in da house */
        lprintf(1, SERVER "\n"