-/* $Id: modules.cpp,v 1.1 2005-05-30 20:09:21 adam Exp $
+/* $Id: modules.cpp,v 1.3 2005-06-21 18:46:04 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
#endif
#include <yaz/nmem.h>
+#include <yaz/log.h>
#include <yazproxy/module.h>
class Yaz_ProxyModule {
Yaz_ProxyModule *get_next() { return m_next; };
int is_module(const char *name);
int authenticate(const char *target_name, void *element_ptr,
- const char *user, const char *group, const char *password);
+ const char *user, const char *group, const char *password,
+ const char *peer_IP);
};
int Yaz_ProxyModule::is_module(const char *name)
int Yaz_ProxyModule::authenticate(const char *name,
void *element_ptr,
const char *user, const char *group,
- const char *password)
+ const char *password,
+ const char *peer_IP)
{
if (m_entry->int_version == 0)
{
if (!int0->authenticate)
return YAZPROXY_RET_NOT_ME;
return (*int0->authenticate)(m_user_handle, name, element_ptr,
- user, group, password);
+ user, group, password, peer_IP);
}
return YAZPROXY_RET_NOT_ME;
}
Yaz_ProxyModules::Yaz_ProxyModules()
{
m_list = 0;
+ m_no_open = 0;
}
{
Yaz_ProxyModule *m_next = m->get_next();
delete m;
+ m_no_open--;
m = m_next;
}
m_list = 0;
const char *target_name, void *element_ptr,
const char *user,
const char *group,
- const char *password)
+ const char *password,
+ const char *peer_IP)
{
int ret = YAZPROXY_RET_NOT_ME;
Yaz_ProxyModule *m = m_list;
if (m->is_module(module_name))
{
ret = m->authenticate(target_name, element_ptr,
- user, group, password);
+ user, group, password,
+ peer_IP);
if (ret != YAZPROXY_RET_NOT_ME)
break;
}
m_list);
m_list = m;
+ m_no_open++;
+ yaz_log(YLOG_LOG, "Loaded module no_open=%d", m_no_open);
return 0;
}
else