]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
* The size constant "256" which shows up everywhere as a buffer size has now
[citadel.git] / citadel / citserver.c
index 24f106b4607deb4d57c8dc2fa715d8c9f2202416..e4d76c02b50c2f68379413d5ca332941fa7d2c52 100644 (file)
@@ -57,7 +57,6 @@ void master_startup(void) {
        lprintf(9, "master_startup() started\n");
        lprintf(7, "Opening databases\n");
        open_databases();
-       cdb_begin_transaction();
 
        if (do_defrag) {
                defrag_databases();
@@ -100,7 +99,6 @@ void master_cleanup(void) {
 
        /* Close databases */
        lprintf(7, "Closing databases\n");
-       cdb_end_transaction();
        close_databases();
 
        /* Do system-dependent stuff */
@@ -380,7 +378,7 @@ static int hostnames_match(const char *realname, const char *testname) {
  */
 int is_public_client(char *where)
 {
-       char buf[256];
+       char buf[SIZ];
        FILE *fp;
 
        lprintf(9, "Checking whether %s is a public client\n", where);
@@ -391,7 +389,7 @@ int is_public_client(char *where)
        fp = fopen("public_clients","r");
        if (fp == NULL) return(0);
 
-       while (fgets(buf,256,fp)!=NULL) {
+       while (fgets(buf, sizeof buf, fp)!=NULL) {
                while (isspace((buf[strlen(buf)-1]))) 
                        buf[strlen(buf)-1] = 0;
                if (hostnames_match(where,buf)) {
@@ -413,8 +411,8 @@ void cmd_iden(char *argbuf)
        int dev_code;
        int cli_code;
        int rev_level;
-       char desc[256];
-       char from_host[256];
+       char desc[SIZ];
+       char from_host[SIZ];
        struct in_addr addr;
        int do_lookup = 0;
 
@@ -479,8 +477,8 @@ void cmd_iden(char *argbuf)
 void cmd_mesg(char *mname)
 {
        FILE *mfp;
-       char targ[256];
-       char buf[256];
+       char targ[SIZ];
+       char buf[SIZ];
        char *dirs[2];
 
        extract(buf,mname,0);
@@ -525,8 +523,8 @@ void cmd_mesg(char *mname)
 void cmd_emsg(char *mname)
 {
        FILE *mfp;
-       char targ[256];
-       char buf[256];
+       char targ[SIZ];
+       char buf[SIZ];
        char *dirs[2];
        int a;
 
@@ -831,7 +829,7 @@ void citproto_begin_session() {
  * This loop recognizes all server commands.
  */
 void do_command_loop(void) {
-       char cmdbuf[256];
+       char cmdbuf[SIZ];
 
        time(&CC->lastcmd);
        memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */