From d225aa4dd4a08e5f13d3cd2d3082f2434d5b9f01 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 26 Nov 1999 03:33:00 +0000 Subject: [PATCH] * Started moving all of the global variables into a struct, to facilitate multithreaded server. --- webcit/ChangeLog | 5 ++- webcit/auth.c | 30 +++++++++--------- webcit/graphics.c | 6 ++-- webcit/mainmenu.c | 10 +++--- webcit/messages.c | 12 ++++---- webcit/paging.c | 4 +-- webcit/roomops.c | 67 +++++++++++++++++++---------------------- webcit/serv_func.c | 2 +- webcit/sysmsgs.c | 2 +- webcit/tcp_sockets.c | 15 ++++----- webcit/webcit.c | 72 +++++++++++++++++++++----------------------- webcit/webcit.h | 43 +++++++++++++++----------- webcit/who.c | 4 +-- 13 files changed, 135 insertions(+), 137 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 23b0524be..ac5917297 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 1.107 1999/11/26 03:32:59 ajc +* Started moving all of the global variables into a struct, to facilitate + multithreaded server. + Revision 1.106 1999/11/26 01:28:10 ajc * 2.01 release @@ -312,4 +316,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/auth.c b/webcit/auth.c index cdb23a9d3..28d89efba 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -91,12 +91,12 @@ void display_login(char *mesg) */ void become_logged_in(char *user, char *pass, char *serv_response) { - logged_in = 1; - extract(wc_username, &serv_response[4], 0); - strcpy(wc_password, pass); - axlevel = extract_int(&serv_response[4], 1); - if (axlevel >= 6) - is_aide = 1; + WC->logged_in = 1; + extract(WC->wc_username, &serv_response[4], 0); + strcpy(WC->wc_password, pass); + WC->axlevel = extract_int(&serv_response[4], 1); + if (WC->axlevel >= 6) + WC->is_aide = 1; } @@ -139,13 +139,13 @@ void do_login(void) return; } } - if (logged_in) { + if (WC->logged_in) { serv_puts("CHEK"); serv_gets(buf); if (buf[0] == '2') { - new_mail = extract_int(&buf[4], 0); + WC->new_mail = extract_int(&buf[4], 0); need_regi = extract_int(&buf[4], 1); - need_vali = extract_int(&buf[4], 2); + WC->need_vali = extract_int(&buf[4], 2); } if (need_regi) { display_reg(1); @@ -168,9 +168,9 @@ void do_logout(void) { char buf[256]; - strcpy(wc_username, ""); - strcpy(wc_password, ""); - strcpy(wc_roomname, ""); + strcpy(WC->wc_username, ""); + strcpy(WC->wc_password, ""); + strcpy(WC->wc_roomname, ""); printf("HTTP/1.0 200 OK\n"); output_headers(2); /* note "2" causes cookies to be unset */ @@ -209,8 +209,8 @@ void validate(void) strcpy(buf, bstr("user")); if (strlen(buf) > 0) - if (strlen(bstr("axlevel")) > 0) { - serv_printf("VALI %s|%s", buf, bstr("axlevel")); + if (strlen(bstr("WC->axlevel")) > 0) { + serv_printf("VALI %s|%s", buf, bstr("WC->axlevel")); serv_gets(buf); if (buf[0] != '2') { wprintf("%s
\n", &buf[4]); @@ -261,7 +261,7 @@ void validate(void) wprintf(""); for (a = 0; a <= 6; ++a) { wprintf( - "%s\n", + "axlevel=%d\">%s\n", urlesc(user), a, axdefs[a]); } wprintf("

\n"); diff --git a/webcit/graphics.c b/webcit/graphics.c index 31887c840..56c4ceebe 100644 --- a/webcit/graphics.c +++ b/webcit/graphics.c @@ -52,7 +52,7 @@ void do_graphics_upload(char *upl_cmd) int pos = 0; int thisblock; - if (upload_length == 0) { + if (WC->upload_length == 0) { display_error("You didn't upload a file.\n"); return; } @@ -62,7 +62,7 @@ void do_graphics_upload(char *upl_cmd) display_error(&buf[4]); return; } - bytes_remaining = upload_length; + bytes_remaining = WC->upload_length; while (bytes_remaining) { thisblock = ((bytes_remaining > 4096) ? 4096 : bytes_remaining); serv_printf("WRIT %d", thisblock); @@ -74,7 +74,7 @@ void do_graphics_upload(char *upl_cmd) return; } thisblock = extract_int(&buf[4], 0); - serv_write(&upload[pos], thisblock); + serv_write(&WC->upload[pos], thisblock); pos = pos + thisblock; bytes_remaining = bytes_remaining - thisblock; } diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index 66f7593b6..8713620f4 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -35,10 +35,10 @@ void embed_main_menu(void) wprintf("Skip to next room
\n"); wprintf("(come back here later)\n"); - if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) { + if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) { wprintf("
  • \n"); wprintf("Ungoto
    \n"); - wprintf("(oops! Back to %s)
  • \n", ugname); + wprintf("(oops! Back to %s)\n", WC->ugname); } wprintf("\n"); @@ -140,7 +140,7 @@ void embed_advanced_menu(void) wprintf("Create a new room\n"); wprintf("
  • "); - wprintf("Zap (forget) this room (%s)\n", wc_roomname); + wprintf("Zap (forget) this room (%s)\n", WC->wc_roomname); wprintf("
  • "); wprintf("List all forgotten rooms\n"); @@ -149,7 +149,7 @@ void embed_advanced_menu(void) wprintf(""); - if ((axlevel >= 6) || (is_room_aide)) { + if ((WC->axlevel >= 6) || (WC->is_room_aide)) { wprintf(""); - if (is_room_aide) { + if (WC->is_room_aide) { wprintf("
    "); wprintf("Administrative functions\n"); @@ -162,7 +162,7 @@ void embed_advanced_menu(void) wprintf("
  • \n"); wprintf("Edit site-wide configuration\n"); - if (axlevel >= 6) { + if (WC->axlevel >= 6) { wprintf("
  • \n"); wprintf("Validate new users\n"); diff --git a/webcit/messages.c b/webcit/messages.c index 0b8aabaad..0af37486a 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -110,11 +110,11 @@ char *oper; && (strcasecmp(&buf[5], serv_info.serv_humannode))) wprintf("(%s) ", &buf[5]); if ((!strncasecmp(buf, "room=", 5)) - && (strcasecmp(&buf[5], wc_roomname))) + && (strcasecmp(&buf[5], WC->wc_roomname))) wprintf("in %s> ", &buf[5]); if (!strncasecmp(buf, "node=", 5)) { - if ((room_flags & QR_NETWORK) + if ((WC->room_flags & QR_NETWORK) || ((strcasecmp(&buf[5], serv_info.serv_nodename) && (strcasecmp(&buf[5], serv_info.serv_fqdn))))) { wprintf("@%s ", &buf[5]); @@ -142,7 +142,7 @@ char *oper; wprintf("****"); wprintf("
  • "); wprintf("
    %s - ", wc_roomname); + wprintf("
    %s - ", WC->wc_roomname); if (!strcmp(oper, "readnew")) { strcpy(cmd, "MSGS NEW"); wprintf("new messages"); @@ -370,10 +370,10 @@ void display_enter(void) buf[strlen(buf) - 1] = 0; strcpy(&buf[16], &buf[19]); wprintf("
    %s ", &buf[4]); - wprintf("from %s ", wc_username); + wprintf("from %s ", WC->wc_username); if (strlen(bstr("recp")) > 0) wprintf("to %s ", bstr("recp")); - wprintf("in %s> ", wc_roomname); + wprintf("in %s> ", WC->wc_roomname); wprintf("
    \n"); wprintf("
    \n"); diff --git a/webcit/paging.c b/webcit/paging.c index 50d637720..828b93452 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -117,8 +117,8 @@ void do_chat(void) wprintf("\n"); - wprintf("\n", wc_username); - wprintf("\n", wc_password); + wprintf("\n", WC->wc_username); + wprintf("\n", WC->wc_password); wprintf("

    Oops!

    Looks like your browser doesn't support Java, "); wprintf("so you won't be able to access Chat. Sorry.\n"); wprintf("
    \n"); diff --git a/webcit/roomops.c b/webcit/roomops.c index 52204caeb..bf47eaa50 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -36,11 +36,6 @@ struct roomlisting { char floorlist[128][256]; -char ugname[128]; -long uglsn = (-1L); -unsigned room_flags; -int is_aide = 0; -int is_room_aide = 0; struct march *march = NULL; @@ -325,22 +320,22 @@ void embed_room_banner(char *got) { * If it isn't supplied, we fake it by issuing our own GOTO. */ if (got == NULL) { - serv_printf("GOTO %s", wc_roomname); + serv_printf("GOTO %s", WC->wc_roomname); serv_gets(fakegot); got = fakegot; } /* Check for new mail. */ - new_mail = extract_int(&got[4], 9); + WC->new_mail = extract_int(&got[4], 9); /* Now start spewing HTML. */ wprintf("
    "); - if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) { + if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) { wprintf(""); } - wprintf("\n", extract_int(&got[4], 1), extract_int(&got[4], 2)); @@ -355,7 +350,7 @@ void embed_room_banner(char *got) { if (buf[0] == '2') { wprintf(""); serv_puts("CLOS"); serv_gets(buf); @@ -365,12 +360,12 @@ void embed_room_banner(char *got) { wprintf(""); /* Let the user know if new mail has arrived */ - if ( (new_mail > remember_new_mail) && (new_mail>0) ) { + if ( (WC->new_mail > remember_new_mail) && (WC->new_mail>0) ) { wprintf("", new_mail); - remember_new_mail = new_mail; + "
    %d", WC->new_mail); + remember_new_mail = WC->new_mail; } wprintf("
    "); wprintf("%s
    ", wc_roomname); + wprintf("
    %s
    ", WC->wc_roomname); wprintf("%d new of %d messages
    "); wprintf("wc_roomname); wprintf("\">" "" - "
    %d
    "); @@ -408,8 +403,8 @@ void gotoroom(char *gname, int display_name) } if (display_name != 2) { /* store ungoto information */ - strcpy(ugname, wc_roomname); - uglsn = ls; + strcpy(WC->ugname, WC->wc_roomname); + WC->uglsn = ls; } /* move to the new room */ serv_printf("GOTO %s", gname); @@ -425,19 +420,19 @@ void gotoroom(char *gname, int display_name) } return; } - extract(wc_roomname, &buf[4], 0); - room_flags = extract_int(&buf[4], 4); + extract(WC->wc_roomname, &buf[4], 0); + WC->room_flags = extract_int(&buf[4], 4); /* highest_msg_read = extract_int(&buf[4],6); maxmsgnum = extract_int(&buf[4],5); is_mail = (char) extract_int(&buf[4],7); */ ls = extract_long(&buf[4], 6); - if (is_aide) - is_room_aide = is_aide; + if (WC->is_aide) + WC->is_room_aide = WC->is_aide; else - is_room_aide = (char) extract_int(&buf[4], 8); + WC->is_room_aide = (char) extract_int(&buf[4], 8); - remove_march(wc_roomname); + remove_march(WC->wc_roomname); if (!strcasecmp(gname, "_BASEROOM_")) remove_march(gname); @@ -446,7 +441,7 @@ void gotoroom(char *gname, int display_name) embed_room_banner(buf); wDumpContent(1); } - strcpy(wc_roomname, wc_roomname); + strcpy(WC->wc_roomname, WC->wc_roomname); } @@ -543,7 +538,7 @@ void gotonext(void) * ...and remove the room we're currently in, so a oto doesn't make us * walk around in circles */ - remove_march(wc_roomname); + remove_march(WC->wc_roomname); } if (march != NULL) { strcpy(next_room, pop_march(-1)); @@ -587,22 +582,22 @@ void ungoto(void) { char buf[256]; - if (!strcmp(ugname, "")) { - smart_goto(wc_roomname); + if (!strcmp(WC->ugname, "")) { + smart_goto(WC->wc_roomname); return; } - serv_printf("GOTO %s", ugname); + serv_printf("GOTO %s", WC->ugname); serv_gets(buf); if (buf[0] != '2') { - smart_goto(wc_roomname); + smart_goto(WC->wc_roomname); return; } - if (uglsn >= 0L) { - serv_printf("SLRP %ld", uglsn); + if (WC->uglsn >= 0L) { + serv_printf("SLRP %ld", WC->uglsn); serv_gets(buf); } - strcpy(buf, ugname); - strcpy(ugname, ""); + strcpy(buf, WC->ugname); + strcpy(WC->ugname, ""); smart_goto(buf); } @@ -1080,7 +1075,7 @@ void goto_private(void) display_main_menu(); return; } - strcpy(hold_rm, wc_roomname); + strcpy(hold_rm, WC->wc_roomname); strcpy(buf, "GOTO "); strcat(buf, bstr("gr_name")); strcat(buf, "|"); @@ -1117,7 +1112,7 @@ void display_zap(void) wprintf("Zap (forget) the current room\n"); wprintf("
    \n"); - wprintf("If you select this option, %s will ", wc_roomname); + wprintf("If you select this option, %s will ", WC->wc_roomname); wprintf("disappear from your room list. Is this what you wish "); wprintf("to do?
    \n"); @@ -1140,10 +1135,10 @@ void zap(void) /* If the forget-room routine fails for any reason, we fall back * to the current room; otherwise, we go to the Lobby */ - strcpy(final_destination, wc_roomname); + strcpy(final_destination, WC->wc_roomname); if (!strcasecmp(bstr("sc"), "OK")) { - serv_printf("GOTO %s", wc_roomname); + serv_printf("GOTO %s", WC->wc_roomname); serv_gets(buf); if (buf[0] != '2') { ExpressMessageCat(&buf[4]); @@ -1187,7 +1182,7 @@ void confirm_delete_room(void) wprintf("\n"); wprintf("Are you sure you want to delete "); - escputs(wc_roomname); + escputs(WC->wc_roomname); wprintf("?
    \n"); wprintf(""); diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 823fb5f85..750ec7d2f 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -13,7 +13,7 @@ struct serv_info serv_info; /* - * get info about the server we've connected to + * get info about the server we've WC->connected to */ void get_serv_info(char *browser_host, char *user_agent) { diff --git a/webcit/sysmsgs.c b/webcit/sysmsgs.c index 5fa17c05b..526068129 100644 --- a/webcit/sysmsgs.c +++ b/webcit/sysmsgs.c @@ -76,7 +76,7 @@ void save_edit(char *description, char *enter_cmd, int regoto) serv_puts("000"); if (regoto) { - smart_goto(wc_roomname); + smart_goto(WC->wc_roomname); } else { printf("HTTP/1.0 200 OK\n"); output_headers(1); diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index bafeea9b5..d7ec10712 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -29,9 +29,6 @@ char server_is_local = 0; extern int errno; -int serv_sock; - - RETSIGTYPE timeout(int signum) { fprintf(stderr, "Connection timed out.\n"); @@ -105,12 +102,12 @@ void serv_read(char *buf, int bytes) len = 0; while (len < bytes) { - rlen = read(serv_sock, &buf[len], bytes - len); + rlen = read(WC->serv_sock, &buf[len], bytes - len); if (rlen < 1) { fprintf(stderr, "Server connection broken: %s\n", strerror(errno)); - connected = 0; - logged_in = 0; + WC->connected = 0; + WC->logged_in = 0; return; } len = len + rlen; @@ -147,13 +144,13 @@ void serv_write(char *buf, int nbytes) int bytes_written = 0; int retval; while (bytes_written < nbytes) { - retval = write(serv_sock, &buf[bytes_written], + retval = write(WC->serv_sock, &buf[bytes_written], nbytes - bytes_written); if (retval < 1) { fprintf(stderr, "Server connection broken: %s\n", strerror(errno)); - connected = 0; - logged_in = 0; + WC->connected = 0; + WC->logged_in = 0; return; } bytes_written = bytes_written + retval; diff --git a/webcit/webcit.c b/webcit/webcit.c index 90ca7cf29..10819551a 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -22,17 +22,8 @@ #include "child.h" #include "mime_parser.h" -int wc_session; -char wc_username[256]; -char wc_password[256]; -char wc_roomname[256]; int TransactionCount = 0; -int connected = 0; -int logged_in = 0; -int axlevel; char *ExpressMessages = NULL; -int new_mail = 0; -int need_vali = 0; /* This variable is set to 1 if the room banner and menubar have been * displayed, and we need to close the tags. @@ -47,10 +38,10 @@ struct urlcontent *urlstrings = NULL; static const char *defaulthost = DEFAULT_HOST; static const char *defaultport = DEFAULT_PORT; -int upload_length = 0; -char *upload; +struct wcsession *WC = NULL; /* FIX take this out when multithreaded */ + void unescape_input(char *buf) { int a, b; @@ -371,8 +362,8 @@ void output_headers(int print_standard_html_head) printf("Pragma: no-cache\n"); printf("Cache-Control: no-store\n"); } - stuff_to_cookie(cookie, wc_session, wc_username, - wc_password, wc_roomname); + stuff_to_cookie(cookie, WC->wc_session, WC->wc_username, + WC->wc_password, WC->wc_roomname); if (print_standard_html_head == 2) { printf("X-WebCit-Session: close\n"); printf("Set-cookie: webcit=%s\n", unset); @@ -628,10 +619,10 @@ void upload_handler(char *name, char *filename, char *encoding, fprintf(stderr, " length = %d\n", length); if (strlen(name) > 0) { - upload = malloc(length); - if (upload != NULL) { - upload_length = length; - memcpy(upload, content, length); + WC->upload = malloc(length); + if (WC->upload != NULL) { + WC->upload_length = length; + memcpy(WC->upload, content, length); } } } @@ -663,8 +654,8 @@ void session_loop(char *browser_host, char *user_agent) strcpy(c_password, ""); strcpy(c_roomname, ""); - upload_length = 0; - upload = NULL; + WC->upload_length = 0; + WC->upload = NULL; if (getz(cmd) == NULL) return; @@ -716,21 +707,21 @@ void session_loop(char *browser_host, char *user_agent) cmd[a] = 0; } /* - * If we're not connected to a Citadel server, try to hook up the + * If we're not WC->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. */ - if (!connected) { + if (!WC->connected) { if (strlen(bstr("host")) > 0) strcpy(c_host, bstr("host")); if (strlen(bstr("port")) > 0) strcpy(c_port, bstr("port")); - serv_sock = connectsock(c_host, c_port, "tcp"); - if (serv_sock < 0) { + WC->serv_sock = connectsock(c_host, c_port, "tcp"); + if (WC->serv_sock < 0) { do_logout(); } - connected = 1; + WC->connected = 1; serv_gets(buf); /* get the server welcome message */ get_serv_info(browser_host, user_agent); } @@ -740,7 +731,7 @@ void session_loop(char *browser_host, char *user_agent) * If we're not logged in, but we have username and password cookies * supplied by the browser, try using them to log in. */ - if ((!logged_in) && (strlen(c_username) > 0) && (strlen(c_password) > 0)) { + if ((!WC->logged_in) && (strlen(c_username) > 0) && (strlen(c_password) > 0)) { serv_printf("USER %s", c_username); serv_gets(buf); if (buf[0] == '3') { @@ -755,11 +746,11 @@ void session_loop(char *browser_host, char *user_agent) * If we don't have a current room, but a cookie specifying the * current room is supplied, make an effort to go there. */ - if ((strlen(wc_roomname) == 0) && (strlen(c_roomname) > 0)) { + if ((strlen(WC->wc_roomname) == 0) && (strlen(c_roomname) > 0)) { serv_printf("GOTO %s", c_roomname); serv_gets(buf); if (buf[0] == '2') { - strcpy(wc_roomname, c_roomname); + strcpy(WC->wc_roomname, c_roomname); } } if (!strcasecmp(action, "static")) { @@ -770,9 +761,9 @@ void session_loop(char *browser_host, char *user_agent) output_static(buf); } else if (!strcasecmp(action, "image")) { output_image(); - } else if ((!logged_in) && (!strcasecmp(action, "login"))) { + } else if ((!WC->logged_in) && (!strcasecmp(action, "login"))) { do_login(); - } else if (!logged_in) { + } else if (!WC->logged_in) { display_login(NULL); } /* Various commands... */ @@ -850,7 +841,7 @@ void session_loop(char *browser_host, char *user_agent) } else if (!strcasecmp(action, "editinfo")) { save_edit("Room info", "EINF 1", 1); } else if (!strcasecmp(action, "display_editbio")) { - sprintf(buf, "RBIO %s", wc_username); + sprintf(buf, "RBIO %s", WC->wc_username); display_edit("Your bio", "NOOP", buf, "editbio"); } else if (!strcasecmp(action, "editbio")) { save_edit("Your bio", "EBIO", 0); @@ -932,7 +923,7 @@ void session_loop(char *browser_host, char *user_agent) output_headers(1); wprintf("TransactionCount is %d
    \n", TransactionCount); - wprintf("You're in session %d
    \n", wc_session); + wprintf("You're in session %d
    \n", WC->wc_session); wprintf("Command:
    \n");
     		escputs(cmd);
     		wprintf("

    \n"); @@ -952,9 +943,9 @@ void session_loop(char *browser_host, char *user_agent) content = NULL; } free_urls(); - if (upload_length > 0) { - free(upload); - upload_length = 0; + if (WC->upload_length > 0) { + free(WC->upload); + WC->upload_length = 0; } } @@ -971,13 +962,18 @@ int main(int argc, char *argv[]) return 1; } - wc_session = atoi(argv[1]); + WC = (struct wcsession *) malloc(sizeof(struct wcsession)); + memset(WC, 0, sizeof(struct wcsession)); + + + + WC->wc_session = atoi(argv[1]); defaulthost = argv[2]; defaultport = argv[3]; - strcpy(wc_username, ""); - strcpy(wc_password, ""); - strcpy(wc_roomname, ""); + strcpy(WC->wc_username, ""); + strcpy(WC->wc_password, ""); + strcpy(WC->wc_roomname, ""); /* Clear out serv_info and temporarily set the value of serv_humannode * to a default value, because it'll be used in HTML page titles diff --git a/webcit/webcit.h b/webcit/webcit.h index a078d222e..a831ec92f 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -66,25 +66,32 @@ struct serv_info { int serv_ok_floors; }; -extern char wc_username[256]; -extern char wc_password[256]; -extern char wc_roomname[256]; -extern int connected; -extern int logged_in; -extern int axlevel; -extern int is_aide; -extern int is_room_aide; -extern int serv_sock; -extern struct serv_info serv_info; -extern unsigned room_flags; -extern char ugname[128]; -extern long uglsn; -extern char *axdefs[]; -extern int upload_length; -extern char *upload; +struct wcsession { + int wc_session; + char wc_username[256]; + char wc_password[256]; + char wc_roomname[256]; + int connected; + int logged_in; + int axlevel; + int is_aide; + int is_room_aide; + int serv_sock; + struct serv_info serv_info; + unsigned room_flags; + char ugname[128]; + long uglsn; + int upload_length; + char *upload; + int new_mail; + int need_vali; +}; + +extern struct wcsession *WC; + +struct serv_info serv_info; extern char floorlist[128][256]; -extern int new_mail; -extern int need_vali; +extern char *axdefs[]; void stuff_to_cookie(char *, int, char *, char *, char *); void cookie_to_stuff(char *, int *, char *, char *, char *); diff --git a/webcit/who.c b/webcit/who.c index 2b8dd0155..c71ce66a4 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -89,7 +89,7 @@ void whobbs(void) while (wlist != NULL) { wprintf("\n\t\n\n"); - if (is_aide) { + if (WC->is_aide) { wprintf("\n
    %d", wlist->sessionnum); - if ((is_aide) && + if ((WC->is_aide) && (wlist->sessionnum != serv_info.serv_pid)) { wprintf(" sessionnum); urlescputs(wlist->username); @@ -230,7 +230,7 @@ void edit_me(void) wprintf(""); wprintf("
    User name:"); wprintf("\n"); wprintf(""); -- 2.30.2