From 5ae04697cc31604cb3e6a4d96c26c78c3824bb1b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 9 Apr 2003 04:02:32 +0000 Subject: [PATCH] * 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. --- webcit/ChangeLog | 8 ++++++++ webcit/paging.c | 31 ++++++++++++++++++------------- webcit/webcit.c | 18 ++++-------------- webcit/webcit.h | 2 +- webcit/webserver.c | 8 ++++---- 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 7b444f264..9d728b98a 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/paging.c b/webcit/paging.c index a3987058e..adca9fbac 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -125,19 +125,24 @@ void do_chat(void) wprintf("Real-time chat\n"); wprintf("\n"); - wprintf("A chat window should be appearing on your screen "); - wprintf("momentarily. When you're "); - wprintf("done, type /quit to exit. You can also "); - wprintf("type /help for more commands.\n"); - - wprintf("\n"); - wprintf("\n", WC->wc_username); - wprintf("\n", WC->wc_password); - wprintf("\n", WC->wc_roomname); - wprintf("

Oops!

Looks like your browser doesn't support Java, "); - wprintf("so you won't be able to access Chat. Sorry.\n"); - wprintf("
\n"); + if (!strcasecmp(ctdlhost, "uds")) { + wprintf("Sorry ... chat is not available here.
\n"); + } + else { + wprintf("A chat window should be appearing on your screen "); + wprintf("momentarily. When you're "); + wprintf("done, type /quit to exit. You can also "); + wprintf("type /help for more commands.\n"); + + wprintf("\n"); + wprintf("\n", WC->wc_username); + wprintf("\n", WC->wc_password); + wprintf("\n", WC->wc_roomname); + wprintf("

Oops!

Looks like your browser doesn't support Java, "); + wprintf("so you won't be able to access Chat. Sorry.\n"); + wprintf("
\n"); + } wDumpContent(1); } diff --git a/webcit/webcit.c b/webcit/webcit.c index 30510ff54..1794832ab 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -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) { diff --git a/webcit/webcit.h b/webcit/webcit.h index 550566bd1..dc480e369 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -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; diff --git a/webcit/webserver.c b/webcit/webserver.c index c15846c61..7924feaeb 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -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" -- 2.39.2