]> code.citadel.org Git - citadel.git/blobdiff - citadel/netproc.c
* Replication fixes
[citadel.git] / citadel / netproc.c
index d66159e2c8ce74103749a6def1958158dd9ae0ac..9a531dea537a8d82e18fbdbf2bf19d4f70e3129a 100644 (file)
@@ -16,6 +16,9 @@
 /* Path to the 'uudecode' utility (needed for network file transfers) */
 #define UUDECODE       "/usr/bin/uudecode"
 
+/* Files used by the networker */
+#define MAILSYSINFO    "./network/mail.sysinfo"
+
 /* Uncomment the DEBUG def to see noisy traces */
 #define DEBUG 1
 
@@ -117,7 +120,7 @@ void strip_trailing_whitespace(char *buf)
 
 
 /*
- * we also load the network/mail.sysinfo table into memory, make changes
+ * we also load the mail.sysinfo table into memory, make changes
  * as we learn more about the network from incoming messages, and write
  * the table back to disk when we're done.
  */
@@ -128,7 +131,7 @@ int load_syslist(void)
        char insys = 0;
        char buf[128];
 
-       fp = fopen("network/mail.sysinfo", "r");
+       fp = fopen(MAILSYSINFO, "r");
        if (fp == NULL)
                return (1);
 
@@ -233,7 +236,7 @@ void rewrite_syslist(void)
        time_t now;
 
        time(&now);
-       newfp = fopen("network/mail.sysinfo", "w");
+       newfp = fopen(MAILSYSINFO, "w");
        for (stemp = slist; stemp != NULL; stemp = stemp->next) {
                if (!strcasecmp(stemp->s_name, config.c_nodename)) {
                        time(&stemp->s_lastcontact);
@@ -482,15 +485,10 @@ void fpmsgfind(FILE *fp, struct minfo *buffer)
                syslog(LOG_ERR, "Magic number check failed for this message");
                goto END;
        }
+
+       memset(buffer, 0, sizeof(struct minfo));
        mtype = getc(fp);
        aflag = getc(fp);
-       buffer->I = 0L;
-       buffer->R[0] = 0;
-       buffer->E[0] = 0;
-       buffer->H[0] = 0;
-       buffer->S[0] = 0;
-       buffer->B[0] = 0;
-       buffer->G[0] = 0;
 
 BONFGM:        b = getc(fp);
        if (b < 0)
@@ -549,6 +547,8 @@ BONFGM:     b = getc(fp);
                strcpy(buffer->G, bbb);
        if (b == 'E')
                strcpy(buffer->E, bbb);
+       if (b == 'Z')
+               strcpy(buffer->Z, bbb);
        goto BONFGM;
 
 END:
@@ -815,6 +815,8 @@ void purge_use_table(GDBM_FILE ut) {
 
 
 
+
+
 /*
  * process incoming files in ./network/spoolin
  */
@@ -841,7 +843,6 @@ void inprocess(void)
        /* Make sure we're in the right directory */
        chdir(bbs_home_directory);
 
-
        /* temporary file to contain a log of rejected dups */
        duplist = tmpfile();
 
@@ -911,11 +912,6 @@ NXMSG:     /* Seek to the beginning of the next message */
                        fclose(message);
 
                        /* process the individual mesage */
-                       minfo.D[0] = 0;
-                       minfo.C[0] = 0;
-                       minfo.B[0] = 0;
-                       minfo.G[0] = 0;
-                       minfo.R[0] = 0;
                        msgfind(tname, &minfo);
                        strncpy(recentmsg.RMnodename, minfo.N, 9);
                        recentmsg.RMnodename[9] = 0;
@@ -1012,7 +1008,6 @@ NXMSG:    /* Seek to the beginning of the next message */
 
                        /* otherwise process it as a normal message */
                        else {
-
                                if (!strcasecmp(minfo.R, "postmaster")) {
                                        strcpy(minfo.R, "");
                                        strcpy(minfo.C, "Aide");
@@ -1074,6 +1069,7 @@ NXMSG:    /* Seek to the beginning of the next message */
                                }
 
                                fclose(message);
+                               
                        }
 
                        unlink(tname);