]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_network.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / serv_network.c
index d56ed128e0bb9f762f66222ae9e6b264e2880cc0..980160f32bdae55f623c8c61ad02dde3bb194d61 100644 (file)
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include <time.h>
 #include "sysdep_decls.h"
 #include "citserver.h"
 #include "support.h"
@@ -39,8 +49,8 @@
 
 
 void cmd_gnet(char *argbuf) {
-       char filename[256];
-       char buf[256];
+       char filename[SIZ];
+       char buf[SIZ];
        FILE *fp;
 
        if (CtdlAccessCheck(ac_room_aide)) return;
@@ -63,9 +73,9 @@ void cmd_gnet(char *argbuf) {
 
 
 void cmd_snet(char *argbuf) {
-       char tempfilename[256];
-       char filename[256];
-       char buf[256];
+       char tempfilename[SIZ];
+       char filename[SIZ];
+       char buf[SIZ];
        FILE *fp;
 
        if (CtdlAccessCheck(ac_room_aide)) return;
@@ -137,7 +147,7 @@ void network_spool_msg(long msgnum, void *userdata) {
 
        /* Generate delivery instructions for each recipient */
        for (nptr = sc->listrecps; nptr != NULL; nptr = nptr->next) {
-               if (instr_len - strlen(instr) < 256) {
+               if (instr_len - strlen(instr) < SIZ) {
                        instr_len = instr_len * 2;
                        instr = reallok(instr, instr_len);
                }
@@ -160,9 +170,9 @@ void network_spool_msg(long msgnum, void *userdata) {
  * Batch up and send all outbound traffic from the current room
  */
 void network_spoolout_current_room(void) {
-       char filename[256];
-       char buf[256];
-       char instr[256];
+       char filename[SIZ];
+       char buf[SIZ];
+       char instr[SIZ];
        FILE *fp;
        struct SpoolControl sc;
        /* struct namelist *digestrecps = NULL; */
@@ -202,7 +212,7 @@ void network_spoolout_current_room(void) {
 
 
        /* Do something useful */
-       CtdlForEachMessage(MSGS_ALL, 0L, (-63), NULL, NULL,
+       CtdlForEachMessage(MSGS_GT, sc.lastsent, (-63), NULL, NULL,
                network_spool_msg, &sc);