int m_max_sockets;
bool m_force_close;
bool m_client_ip;
+ bool m_bind_host;
std::string m_charset;
std::string m_default_target;
std::string m_force_target;
m_p->m_max_sockets = 0;
m_p->m_force_close = false;
m_p->m_client_ip = false;
+ m_p->m_bind_host = false;
}
yf::Z3950Client::~Z3950Client() {
c->m_waiting = true;
if (!c->m_connected)
{
- if (c->client(c->m_host.c_str()))
+ std::string host(c->m_host);
+
+ if (m_bind_host)
+ {
+ std::string bind_host = package.origin().get_bind_address();
+ if (bind_host.length())
+ {
+ host.append(" ");
+ host.append(bind_host);
+ }
+ }
+ if (c->client(host.c_str()))
{
mp::odr odr;
package.response() =
{
m_p->m_charset = mp::xml::get_text(ptr);
}
+ else if (!strcmp((const char *) ptr->name, "bind_host"))
+ {
+ m_p->m_bind_host = mp::xml::get_bool(ptr, 0);
+ }
else
{
throw mp::filter::FilterException("Bad element "