/*
* Batch up and send all outbound traffic from the current room
*/
-void network_spoolout_room(char *room_to_spool) {
+void network_spoolout_room(char *room_to_spool,
+ char *working_ignetcfg,
+ NetMap *the_netmap)
+{
char buf[SIZ];
char filename[PATH_MAX];
SpoolControl *sc;
}
syslog(LOG_INFO, "Networking started for <%s>\n", CC->room.QRname);
+ sc->working_ignetcfg = working_ignetcfg;
+ sc->the_netmap = the_netmap;
+
/* If there are digest recipients, we have to build a digest */
if (sc->digestrecps != NULL) {
sc->digestfp = tmpfile();
char filename[PATH_MAX];
char cmd[PATH_MAX];
char nexthop[256];
+ long nexthoplen;
int i;
char *ptr;
&& (strcmp(d->d_name, ".."))
&& (strchr(d->d_name, '@') != NULL)
) {
- safestrncpy(nexthop, d->d_name, sizeof nexthop);
+ nexthoplen = safestrncpy(nexthop, d->d_name, sizeof nexthop);
ptr = strchr(nexthop, '@');
- if (ptr) *ptr = 0;
+ if (ptr) {
+ *ptr = 0;
+ nexthoplen = ptr - nexthop;
+ }
snprintf(filename,
sizeof filename,
);
syslog(LOG_DEBUG, "Consolidate %s to %s\n", filename, nexthop);
- if (network_talking_to(nexthop, NTT_CHECK)) {
+ if (network_talking_to(nexthop, nexthoplen, NTT_CHECK)) {
syslog(LOG_DEBUG,
"Currently online with %s - skipping for now\n",
nexthop
);
}
else {
- network_talking_to(nexthop, NTT_ADD);
+ network_talking_to(nexthop, nexthoplen, NTT_ADD);
snprintf(cmd, sizeof cmd, "/bin/cat %s >>%s/%s && /bin/rm -f %s",
filename,
ctdl_netout_dir, nexthop,
filename
);
system(cmd);
- network_talking_to(nexthop, NTT_REMOVE);
+ network_talking_to(nexthop, nexthoplen, NTT_REMOVE);
}
}
}