Now the text client and webcit show the servers svn revision too.
authorDave West <davew@uncensored.citadel.org>
Thu, 20 Mar 2008 19:22:26 +0000 (19:22 +0000)
committerDave West <davew@uncensored.citadel.org>
Thu, 20 Mar 2008 19:22:26 +0000 (19:22 +0000)
citadel/citadel.c
citadel/citadel_ipc.c
citadel/citadel_ipc.h
citadel/citserver.c
webcit/serv_func.c
webcit/summary.c
webcit/webcit.h

index b2d2b5d3884e33681a1ba4d6381a7c95f825f01d..8b643e28b1b02f76f0f22b6c7bc638d0fe9a9ebd 100644 (file)
@@ -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);
index 9e0c43377e7e6bfa7990523c0ea5ed10b1d46936..7bb8caad0635a33365389f112e6b08e2315fe431 100644 (file)
@@ -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;
                        }
                }
 
index 635d39f2e83fe860af66dde7a0bb8f8f932cdb39..ca41a3b0459e8e1ca918bc1f11d950d28fa5a9f1 100644 (file)
@@ -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 */
index 2ec71080903b30562e41d753f29d9eeecfac2c4d..9e78857188c305105722dabc0a0537edf77a9f83 100644 (file)
@@ -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");
 }
index a5d37199b3fa408471aeb9e3ee74bc3824b284eb..ac8a2e77043bbaae23721899de87e6af13a8fda5 100644 (file)
@@ -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;
        }
index a98e421e0a1f88b87e634abeaa92faad30261554..08b73f407c46c7fde12b155e787e78492cc02559 100644 (file)
@@ -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);
index 2265e9bd7f8708617fce291af7c25e3819a4d1e3..7dd9d277c3d0632e8cc84da84ffe304663f78f0e 100644 (file)
@@ -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 */
 };