From 64a5147f8515dbfbd8847f9d453d1255dc3bbee7 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 18 May 2000 02:33:39 +0000 Subject: [PATCH] * Don't call whobbs() directly after changing masq room/host, it screws up the refresh. It now calls an HTTP redirect page instead. * added http_redirect(char *url) function to accomplish the above --- webcit/ChangeLog | 6 ++++++ webcit/webcit.c | 15 +++++++++++++++ webcit/webcit.h | 1 + webcit/who.c | 9 ++++----- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 4916c5aa5..e881d9c78 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,9 @@ $Log$ +Revision 211.19 2000/05/18 02:33:39 ajc +* Don't call whobbs() directly after changing masq room/host, it screws up the + refresh. It now calls an HTTP redirect page instead. +* added http_redirect(char *url) function to accomplish the above + Revision 211.18 2000/05/08 17:24:32 ajc * Removed HTTP date fields because it was confusing browser caches (weird) * Moved express messages to a pop-up HTML window (as opposed to a dialog box) @@ -439,3 +444,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/webcit.c b/webcit/webcit.c index e94bd4969..4363e642a 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -369,6 +369,21 @@ void output_headers(int controlcode) } +/* + * + */ +void http_redirect(char *whichpage) { + wprintf("HTTP/1.0 302 Moved Temporarily\n"); + wprintf("Location: %s\n", whichpage); + wprintf("URI: %s\n", whichpage); + wprintf("Content-type: text/html\n\n"); + wprintf("\n"); + wprintf("you really want to be here now\n", + whichpage); + wprintf("\n"); +} + + void check_for_express_messages() { diff --git a/webcit/webcit.h b/webcit/webcit.h index 3e77ef36d..84904bc03 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -259,3 +259,4 @@ void fmt_date(char *buf, time_t thetime); void httpdate(char *buf, time_t thetime); void end_webcit_session(void); void page_popup(void); +void http_redirect(char *); diff --git a/webcit/who.c b/webcit/who.c index 8fa8ed8ff..39897d7d0 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -160,7 +160,6 @@ void terminate_session(void) } - /* * Change your session info (fake roomname and hostname) */ @@ -171,17 +170,17 @@ void edit_me(void) if (!strcasecmp(bstr("sc"), "Change room name")) { serv_printf("RCHG %s", bstr("fake_roomname")); serv_gets(buf); - whobbs(); + http_redirect("/whobbs"); } else if (!strcasecmp(bstr("sc"), "Change host name")) { serv_printf("HCHG %s", bstr("fake_hostname")); serv_gets(buf); - whobbs(); + http_redirect("/whobbs"); } else if (!strcasecmp(bstr("sc"), "Change user name")) { serv_printf("UCHG %s", bstr("fake_username")); serv_gets(buf); - whobbs(); + http_redirect("/whobbs"); } else if (!strcasecmp(bstr("sc"), "Cancel")) { - whobbs(); + http_redirect("/whobbs"); } else { output_headers(3); -- 2.39.2