Don't log each table open/close, just the whole operation
authorArt Cancro <ajc@citadel.org>
Mon, 8 Jan 2024 16:57:28 +0000 (11:57 -0500)
committerArt Cancro <ajc@citadel.org>
Mon, 8 Jan 2024 16:57:28 +0000 (11:57 -0500)
citadel/server/backends/berkeley_db/berkeley_db.c
citadel/server/modules/calendar/serv_calendar.c

index 59b29ce7f78c8d78679902dbfaa1f03cd0bf2559..a8b8bcbd6694c99f5c1c46da88730adda829f672 100644 (file)
@@ -266,7 +266,6 @@ void bdb_open_databases(void) {
        }
 
        for (i = 0; i < MAXCDB; ++i) {
-               syslog(LOG_INFO, "bdb: mounting database %02x", i);
                ret = db_create(&bdb_table[i], bdb_env, 0);                             // Create a database handle
                if (ret) {
                        syslog(LOG_ERR, "bdb: db_create: %s", db_strerror(ret));
@@ -312,7 +311,6 @@ void bdb_close_databases(void) {
        // close the tables
        syslog(LOG_INFO, "bdb: closing databases");
        for (i = 0; i < MAXCDB; ++i) {
-               syslog(LOG_INFO, "bdb: closing database %02x", i);
                ret = bdb_table[i]->close(bdb_table[i], 0);
                if (ret) {
                        syslog(LOG_ERR, "bdb: db_close: %s", db_strerror(ret));
index 6b05678a079c5215d9eb2c9f1d91153463599a57..2569fb5dd43d22ffcc7c29c8338a55dfc68602a2 100644 (file)
@@ -1545,8 +1545,9 @@ void ical_getics(void) {
        icalcomponent *encaps = NULL;
        char *ser = NULL;
 
+       // Only allow this operation if we're in a room containing a calendar or tasks view
        if (    (CC->room.QRdefaultview != VIEW_CALENDAR)
-               &&(CC->room.QRdefaultview != VIEW_TASKS)
+               && (CC->room.QRdefaultview != VIEW_TASKS)
        ) {
                cprintf("%d Not a calendar room\n", ERROR+NOT_HERE);
                return;         // This room does not contain a calendar.
@@ -1617,7 +1618,7 @@ void ical_putics(void) {
                && (CC->room.QRdefaultview != VIEW_TASKS)
        ) {
                cprintf("%d Not a calendar room\n", ERROR+NOT_HERE);
-               return;
+               return;         // This room does not contain a calendar.
        }
 
        // Only allow this operation if we have permission to overwrite the existing calendar
@@ -2330,7 +2331,20 @@ void ical_fixed_output(char *ptr, int len) {
 // fundamentally handled in the Citadel Server.  A web implementation should be able to just
 // change the encapsulation to HTTP with the data format unchanged.
 void ical_report(void) {
-       cprintf("%d Hi from Citadel\n", CIT_OK);
+       char buf[SIZ];
+
+       // Only allow this operation if we're in a room containing a calendar or tasks view
+       if (    (CC->room.QRdefaultview != VIEW_CALENDAR)
+               && (CC->room.QRdefaultview != VIEW_TASKS)
+       ) {
+               cprintf("%d Not a calendar room\n", ERROR+NOT_HERE);
+               return;         // This room does not contain a calendar.
+       }
+
+       cprintf("%d Send query then receive response\n", SEND_THEN_RECV);
+       while(client_getln(buf, sizeof buf) >= 0 && strcmp(buf,"000")) {
+       }
+       cprintf("000\n");
 }