* Removed the completely redunant function get_mm()
[citadel.git] / citadel / control.c
index d340fcd0539795eb36813ef9f91c2e90b4130bc6..5ef54287aee0154d3710c1543d70c5c940f606f3 100644 (file)
@@ -70,6 +70,14 @@ void lock_control(void)
  */
 void get_control(void)
 {
+       static int already_have_control = 0;
+
+       /*
+        * If we already have the control record in memory, there's no point
+        * in reading it from disk again.
+        */
+       if (already_have_control) return;
+
        /* Zero it out.  If the control record on disk is missing or short,
         * the system functions with all control record fields initialized
         * to zero.
@@ -102,6 +110,7 @@ void get_control(void)
 
        rewind(control_fp);
        fread(&CitControl, sizeof(struct CitControl), 1, control_fp);
+       already_have_control = 1;
 }
 
 /*
@@ -118,6 +127,15 @@ void put_control(void)
        }
 }
 
+/**
+ * release_control - close our fd on exit
+ */
+void release_control(void)
+{
+       if (control_fp != NULL)
+               fclose(control_fp);
+       control_fp = NULL;
+}
 
 /*
  * get_new_message_number()  -  Obtain a new, unique ID to be used for a message.
@@ -247,6 +265,7 @@ void cmd_conf(char *argbuf)
                cprintf("%d\n", config.c_funambol_port);
                cprintf("%s\n", config.c_funambol_source);
                cprintf("%s\n", config.c_funambol_auth);
+               cprintf("%d\n", config.c_rbl_at_greeting);
                cprintf("000\n");
        }
 
@@ -471,6 +490,9 @@ void cmd_conf(char *argbuf)
                                        buf,
                                        sizeof config.c_funambol_auth);
                                break;
+                       case 57:
+                               config.c_rbl_at_greeting = atoi(buf);
+                               break;
                        }
                        ++a;
                }