X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fnetwork%2Fserv_netspool.c;h=3dfec6375a9c379d4accf83812f327ae54ac2a0a;hb=55013f95f08eafe1b375df4241e8defe387c6cdc;hp=a309a0b7c4a0f93d2eeb2c46a59192a29eb39e2f;hpb=5e3befebe2ed0ce85324da3be83b21880dc7d069;p=citadel.git diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index a309a0b7c..3dfec6375 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -72,7 +72,6 @@ #include "internet_addressing.h" #include "serv_network.h" #include "clientsocket.h" -#include "file_ops.h" #include "citadel_dirs.h" #include "threads.h" #include "context.h" @@ -421,7 +420,7 @@ void network_process_buffer(char *buffer, long size, HashList *working_ignetcfg, struct CtdlMessage *msg = NULL; long pos; int field; - struct recptypes *recp = NULL; + recptypes *recp = NULL; char target_room[ROOMNAMELEN]; struct ser_ret sermsg; char filename[PATH_MAX]; @@ -463,7 +462,7 @@ void network_process_buffer(char *buffer, long size, HashList *working_ignetcfg, if (strcasecmp(msg->cm_fields[eDestination], config.c_nodename)) { /* route the message */ - Buf = NewStrBufPlain(msg->cm_fields[eDestination], -1); + Buf = NewStrBufPlain(CM_KEY(msg,eDestination)); if (CtdlIsValidNode(&nexthop, NULL, Buf, @@ -473,7 +472,7 @@ void network_process_buffer(char *buffer, long size, HashList *working_ignetcfg, Netmap_AddMe(msg, HKEY("unknown_user")); /* serialize the message */ - serialize_message(&sermsg, msg); + CtdlSerializeMessage(&sermsg, msg); /* now send it */ if (StrLength(nexthop) == 0) { @@ -624,7 +623,7 @@ void network_process_file(char *filename, long msgend = (-1L); long msgcur = 0L; int ch; - + int nMessages = 0; fp = fopen(filename, "rb"); if (fp == NULL) { @@ -653,6 +652,7 @@ void network_process_file(char *filename, } ++msgcur; + nMessages ++; } msgend = msgcur - 1; @@ -663,8 +663,15 @@ void network_process_file(char *filename, working_ignetcfg, the_netmap, netmap_changed); + nMessages ++; } + if (nMessages > 0) + QN_syslog(LOG_INFO, + "network: processed %d messages in %s\n", + nMessages, + filename); + fclose(fp); unlink(filename); }