X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=actions.c;h=875e1d9ee4b43a23cb1e842c6959e35c574a8c2a;hp=e58b6a85678479de9f9895d005c9c9de2a35ac32;hb=1f58f8d9169e09e541e357ecb39ce3bf2a0325cf;hpb=1251e702bce39f773f2213aa419d0254cb0a4a2e diff --git a/actions.c b/actions.c index e58b6a85..875e1d9e 100644 --- a/actions.c +++ b/actions.c @@ -1,4 +1,4 @@ -const char actions_rcs[] = "$Id: actions.c,v 1.22 2002/01/21 00:27:02 jongfoster Exp $"; +const char actions_rcs[] = "$Id: actions.c,v 1.24 2002/03/16 23:54:06 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/actions.c,v $ @@ -7,7 +7,7 @@ const char actions_rcs[] = "$Id: actions.c,v 1.22 2002/01/21 00:27:02 jongfoster * Functions declared include: FIXME * * Copyright : Written by and Copyright (C) 2001 the SourceForge - * IJBSWA team. http://ijbswa.sourceforge.net + * Privoxy team. http://ijbswa.sourceforge.net * * Based on the Internet Junkbuster originally written * by and Copyright (C) 1997 Anonymous Coders and @@ -33,6 +33,16 @@ const char actions_rcs[] = "$Id: actions.c,v 1.22 2002/01/21 00:27:02 jongfoster * * Revisions : * $Log: actions.c,v $ + * Revision 1.24 2002/03/16 23:54:06 jongfoster + * Adding graceful termination feature, to help look for memory leaks. + * If you enable this (which, by design, has to be done by hand + * editing config.h) and then go to http://i.j.b/die, then the program + * will exit cleanly after the *next* request. It should free all the + * memory that was used. + * + * Revision 1.23 2002/03/07 03:46:16 oes + * Fixed compiler warnings + * * Revision 1.22 2002/01/21 00:27:02 jongfoster * Allowing free_action(NULL). * Moving the functions that #include actionlist.h to the end of the file, @@ -804,6 +814,33 @@ void free_current_action (struct current_action_spec *src) } +static struct file_list *current_actions_file = NULL; + + +#ifdef FEATURE_GRACEFUL_TERMINATION +/********************************************************************* + * + * Function : unload_current_actions_file + * + * Description : Unloads current actions file - reset to state at + * beginning of program. + * + * Parameters : None + * + * Returns : N/A + * + *********************************************************************/ +void unload_current_actions_file(void) +{ + if (current_actions_file) + { + current_actions_file->unloader = unload_actions_file; + current_actions_file = NULL; + } +} +#endif /* FEATURE_GRACEFUL_TERMINATION */ + + /********************************************************************* * * Function : unload_actions_file @@ -874,7 +911,6 @@ void free_alias_list(struct action_alias *alias_list) *********************************************************************/ int load_actions_file(struct client_state *csp) { - static struct file_list *current_actions_file = NULL; /* * Parser mode.