From d3c27d6b3d4e44988b40002c2f4cb8d51f56001a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 10 Jun 2005 22:53:43 +0000 Subject: [PATCH] Yaz_ProxyModules keeps track of number of open modules. --- include/yazproxy/module.h | 3 ++- src/modules.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/yazproxy/module.h b/include/yazproxy/module.h index d701209..2e9917b 100644 --- a/include/yazproxy/module.h +++ b/include/yazproxy/module.h @@ -1,4 +1,4 @@ -/* $Id: module.h,v 1.3 2005-05-30 20:09:20 adam Exp $ +/* $Id: module.h,v 1.4 2005-06-10 22:53:43 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -66,6 +66,7 @@ class Yaz_ProxyModules { void unload_modules(); private: Yaz_ProxyModule *m_list; + int m_no_open; }; #endif diff --git a/src/modules.cpp b/src/modules.cpp index 4e7f473..18238b6 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -1,4 +1,4 @@ -/* $Id: modules.cpp,v 1.1 2005-05-30 20:09:21 adam Exp $ +/* $Id: modules.cpp,v 1.2 2005-06-10 22:53:43 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -25,6 +25,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #endif #include +#include #include class Yaz_ProxyModule { @@ -103,6 +104,7 @@ int Yaz_ProxyModule::authenticate(const char *name, Yaz_ProxyModules::Yaz_ProxyModules() { m_list = 0; + m_no_open = 0; } @@ -118,6 +120,7 @@ void Yaz_ProxyModules::unload_modules() { Yaz_ProxyModule *m_next = m->get_next(); delete m; + m_no_open--; m = m_next; } m_list = 0; @@ -161,6 +164,8 @@ int Yaz_ProxyModules::add_module(const char *fname) m_list); m_list = m; + m_no_open++; + yaz_log(YLOG_LOG, "Loaded module no_open=%d", m_no_open); return 0; } else -- 1.7.10.4