projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
103cac2
)
Networker: Memleaks; make the_netmap pass in both directions, as it was meant to.
author
Wilfried Goesgens
<dothebart@citadel.org>
Fri, 20 Jan 2012 20:22:51 +0000
(21:22 +0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Fri, 20 Jan 2012 20:22:51 +0000
(21:22 +0100)
citadel/modules/network/netspool.h
patch
|
blob
|
history
citadel/modules/network/serv_netmail.c
patch
|
blob
|
history
citadel/modules/network/serv_netspool.c
patch
|
blob
|
history
citadel/modules/network/serv_network.c
patch
|
blob
|
history
diff --git
a/citadel/modules/network/netspool.h
b/citadel/modules/network/netspool.h
index fd2b3c209d33610e70bd0fb0527540359fd96961..7e26e28af27ced81456a3c5b9228ce938aac4542 100644
(file)
--- a/
citadel/modules/network/netspool.h
+++ b/
citadel/modules/network/netspool.h
@@
-27,7
+27,7
@@
struct SpoolControl {
void network_spoolout_room(char *room_to_spool,
char *working_ignetcfg,
NetMap *the_netmap);
void network_spoolout_room(char *room_to_spool,
char *working_ignetcfg,
NetMap *the_netmap);
-void network_do_spoolin(char *working_ignetcfg, NetMap *the_netmap, int *netmap_changed);
+void network_do_spoolin(char *working_ignetcfg, NetMap *
*
the_netmap, int *netmap_changed);
void network_consolidate_spoolout(char *working_ignetcfg, NetMap *the_netmap);
void free_spoolcontrol_struct(SpoolControl **scc);
int writenfree_spoolcontrol_file(SpoolControl **scc, char *filename);
void network_consolidate_spoolout(char *working_ignetcfg, NetMap *the_netmap);
void free_spoolcontrol_struct(SpoolControl **scc);
int writenfree_spoolcontrol_file(SpoolControl **scc, char *filename);
diff --git
a/citadel/modules/network/serv_netmail.c
b/citadel/modules/network/serv_netmail.c
index 6d8d435be93d3ffe115210db74c2b4794e316708..709877a64a6454cc74530d6f5dcde76942a36f9f 100644
(file)
--- a/
citadel/modules/network/serv_netmail.c
+++ b/
citadel/modules/network/serv_netmail.c
@@
-447,7
+447,7
@@
void network_spool_msg(long msgnum,
FreeStrBuf(&CC->redirect_buffer);
sc->num_msgs_spooled += 1;
FreeStrBuf(&CC->redirect_buffer);
sc->num_msgs_spooled += 1;
-
fre
e(msg);
+
CtdlFreeMessag
e(msg);
}
}
}
}
diff --git
a/citadel/modules/network/serv_netspool.c
b/citadel/modules/network/serv_netspool.c
index 5dd1eafb2be0350e47f81570fdf7832c74ec85b7..fbd0eb0e5f6bf9b13e6028fe3c34b0637e9f261d 100644
(file)
--- a/
citadel/modules/network/serv_netspool.c
+++ b/
citadel/modules/network/serv_netspool.c
@@
-95,14
+95,14
@@
/*
* Learn topology from path fields
*/
/*
* Learn topology from path fields
*/
-void network_learn_topology(char *node, char *path, NetMap *the_netmap, int *netmap_changed) {
+void network_learn_topology(char *node, char *path, NetMap *
*
the_netmap, int *netmap_changed) {
char nexthop[256];
NetMap *nmptr;
char nexthop[256];
NetMap *nmptr;
-
strcpy(nexthop, "")
;
+
*nexthop = '\0'
;
if (num_tokens(path, '!') < 3) return;
if (num_tokens(path, '!') < 3) return;
- for (nmptr = the_netmap; nmptr != NULL; nmptr = nmptr->next) {
+ for (nmptr =
*
the_netmap; nmptr != NULL; nmptr = nmptr->next) {
if (!strcasecmp(nmptr->nodename, node)) {
extract_token(nmptr->nexthop, path, 0, '!', sizeof nmptr->nexthop);
nmptr->lastcontact = time(NULL);
if (!strcasecmp(nmptr->nodename, node)) {
extract_token(nmptr->nexthop, path, 0, '!', sizeof nmptr->nexthop);
nmptr->lastcontact = time(NULL);
@@
-116,8
+116,8
@@
void network_learn_topology(char *node, char *path, NetMap *the_netmap, int *net
strcpy(nmptr->nodename, node);
nmptr->lastcontact = time(NULL);
extract_token(nmptr->nexthop, path, 0, '!', sizeof nmptr->nexthop);
strcpy(nmptr->nodename, node);
nmptr->lastcontact = time(NULL);
extract_token(nmptr->nexthop, path, 0, '!', sizeof nmptr->nexthop);
- nmptr->next = the_netmap;
- the_netmap = nmptr;
+ nmptr->next =
*
the_netmap;
+ the_netmap =
&
nmptr;
(*netmap_changed) ++;
}
(*netmap_changed) ++;
}
@@
-451,7
+451,7
@@
void network_spoolout_room(char *room_to_spool,
* Process a buffer containing a single message from a single file
* from the inbound queue
*/
* Process a buffer containing a single message from a single file
* from the inbound queue
*/
-void network_process_buffer(char *buffer, long size, char *working_ignetcfg, NetMap *the_netmap, int *netmap_changed)
+void network_process_buffer(char *buffer, long size, char *working_ignetcfg, NetMap *
*
the_netmap, int *netmap_changed)
{
struct CtdlMessage *msg = NULL;
long pos;
{
struct CtdlMessage *msg = NULL;
long pos;
@@
-503,7
+503,7
@@
void network_process_buffer(char *buffer, long size, char *working_ignetcfg, Net
NULL,
msg->cm_fields['D'],
working_ignetcfg,
NULL,
msg->cm_fields['D'],
working_ignetcfg,
- the_netmap) == 0)
+
*
the_netmap) == 0)
{
/* prepend our node to the path */
if (msg->cm_fields['P'] != NULL) {
{
/* prepend our node to the path */
if (msg->cm_fields['P'] != NULL) {
@@
-635,7
+635,7
@@
void network_process_message(FILE *fp,
long msgstart,
long msgend,
char *working_ignetcfg,
long msgstart,
long msgend,
char *working_ignetcfg,
- NetMap *the_netmap,
+ NetMap *
*
the_netmap,
int *netmap_changed)
{
long hold_pos;
int *netmap_changed)
{
long hold_pos;
@@
-666,7
+666,7
@@
void network_process_message(FILE *fp,
*/
void network_process_file(char *filename,
char *working_ignetcfg,
*/
void network_process_file(char *filename,
char *working_ignetcfg,
- NetMap *the_netmap,
+ NetMap *
*
the_netmap,
int *netmap_changed)
{
FILE *fp;
int *netmap_changed)
{
FILE *fp;
@@
-723,7
+723,7
@@
void network_process_file(char *filename,
/*
* Process anything in the inbound queue
*/
/*
* Process anything in the inbound queue
*/
-void network_do_spoolin(char *working_ignetcfg, NetMap *the_netmap, int *netmap_changed)
+void network_do_spoolin(char *working_ignetcfg, NetMap *
*
the_netmap, int *netmap_changed)
{
DIR *dp;
struct dirent *d;
{
DIR *dp;
struct dirent *d;
diff --git
a/citadel/modules/network/serv_network.c
b/citadel/modules/network/serv_network.c
index b3d19e31d4e9b4284f67f44784d88a783a413af6..7062a15f53213ddd4a609a4aa127abf7ee52232f 100644
(file)
--- a/
citadel/modules/network/serv_network.c
+++ b/
citadel/modules/network/serv_network.c
@@
-481,7
+481,7
@@
void network_do_queue(void) {
/* If there is anything in the inbound queue, process it */
if (!server_shutting_down) {
network_do_spoolin(working_ignetcfg,
/* If there is anything in the inbound queue, process it */
if (!server_shutting_down) {
network_do_spoolin(working_ignetcfg,
- the_netmap,
+
&
the_netmap,
&netmap_changed);
}
&netmap_changed);
}