From 266e75a42b41389c5fe5de8e66b725dcc79e9062 Mon Sep 17 00:00:00 2001 From: Dave West Date: Thu, 20 Mar 2008 19:22:26 +0000 Subject: [PATCH] Now the text client and webcit show the servers svn revision too. --- citadel/citadel.c | 1 + citadel/citadel_ipc.c | 17 +++++++++++++++++ citadel/citadel_ipc.h | 7 +++++++ citadel/citserver.c | 1 + webcit/serv_func.c | 3 +++ webcit/summary.c | 3 ++- webcit/webcit.h | 1 + 7 files changed, 32 insertions(+), 1 deletion(-) diff --git a/citadel/citadel.c b/citadel/citadel.c index b2d2b5d38..8b643e28b 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -1020,6 +1020,7 @@ void system_info(CtdlIPC *ipc) scr_printf("You are connected to %s (%s) @%s\n", ipc->ServInfo.nodename, ipc->ServInfo.humannode, ipc->ServInfo.fqdn); scr_printf("running %s with text client v%.2f,\n", ipc->ServInfo.software, (float)REV_LEVEL/100); + scr_printf("server build %s,\n", ipc->ServInfo.svn_revision, (float)REV_LEVEL/100); scr_printf("and located in %s.\n", ipc->ServInfo.site_location); scr_printf("Connected users %d / Active users %d / Highest message #%ld\n", mrtg_users, mrtg_active_users, mrtg_himessage); scr_printf("Server uptime: %s\n", mrtg_server_uptime); diff --git a/citadel/citadel_ipc.c b/citadel/citadel_ipc.c index 9e0c43377..7bb8caad0 100644 --- a/citadel/citadel_ipc.c +++ b/citadel/citadel_ipc.c @@ -80,6 +80,9 @@ static void CtdlIPC_getline(CtdlIPC* ipc, char *buf); static void CtdlIPC_putline(CtdlIPC *ipc, const char *buf); + +const char *svn_revision(void); + /* * Does nothing. The server should always return 200. */ @@ -717,6 +720,20 @@ int CtdlIPCServerInfo(CtdlIPC *ipc, char *cret) break; case 15: ipc->ServInfo.newuser_disabled = atoi(buf); break; + case 16: strcpy(ipc->ServInfo.default_cal_zone, buf); + break; + case 17: ipc->ServInfo.load_avg = atof(buf); + break; + case 18: ipc->ServInfo.worker_avg = atof(buf); + break; + case 19: ipc->ServInfo.thread_count = atoi(buf); + break; + case 20: ipc->ServInfo.has_sieve = atoi(buf); + break; + case 21: ipc->ServInfo.fulltext_enabled = atoi(buf); + break; + case 22: strcpy(ipc->ServInfo.svn_revision, buf); + break; } } diff --git a/citadel/citadel_ipc.h b/citadel/citadel_ipc.h index 635d39f2e..ca41a3b04 100644 --- a/citadel/citadel_ipc.h +++ b/citadel/citadel_ipc.h @@ -48,6 +48,13 @@ struct CtdlServInfo { int supports_qnop; int supports_ldap; int newuser_disabled; + char default_cal_zone[256]; + double load_avg; + double worker_avg; + int thread_count; + int has_sieve; + int fulltext_enabled; + char svn_revision[256]; }; /* This class is responsible for the server connection */ diff --git a/citadel/citserver.c b/citadel/citserver.c index 2ec710809..9e7885718 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -307,6 +307,7 @@ void cmd_info(void) { cprintf("1\n"); /* yes, Sieve mail filtering is supported */ cprintf("%d\n", config.c_enable_fulltext); + cprintf("%s\n", svn_revision()); cprintf("000\n"); } diff --git a/webcit/serv_func.c b/webcit/serv_func.c index a5d37199b..ac8a2e770 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -92,6 +92,9 @@ void get_serv_info(char *browser_host, char *user_agent) case 21: serv_info.serv_fulltext_enabled = atoi(buf); break; + case 22: + safestrncpy(serv_info.serv_svn_revision, buf, sizeof serv_info.serv_svn_revision); + break; } ++a; } diff --git a/webcit/summary.c b/webcit/summary.c index a98e421e0..08b73f407 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -137,10 +137,11 @@ void server_info_section(void) { char message[512]; snprintf(message, sizeof message, - _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."), + _("You are connected to %s, running %s with %s, server build %s and located in %s. Your system administrator is %s."), serv_info.serv_humannode, serv_info.serv_software, PACKAGE_STRING, + serv_info.serv_svn_revision, serv_info.serv_bbs_city, serv_info.serv_sysadm); escputs(message); diff --git a/webcit/webcit.h b/webcit/webcit.h index 2265e9bd7..7dd9d277c 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -250,6 +250,7 @@ struct serv_info { char serv_default_cal_zone[128];/* Default timezone for unspecified calendar items */ int serv_supports_sieve; /* Does the server support Sieve mail filtering? */ int serv_fulltext_enabled; /* Does the server have the full text index enabled? */ + char serv_svn_revision[256]; /* SVN revision of the server */ }; -- 2.30.2