metaproxy  1.13.0
filter_z3950_client.cpp
Go to the documentation of this file.
1 /* This file is part of Metaproxy.
2  Copyright (C) Index Data
3 
4 Metaproxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8 
9 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #include "config.hpp"
20 
21 #include "filter_z3950_client.hpp"
22 #include <metaproxy/package.hpp>
23 #include <metaproxy/util.hpp>
24 
25 #include <map>
26 #include <stdexcept>
27 #include <list>
28 #include <iostream>
29 
30 #include <boost/thread/mutex.hpp>
31 #include <boost/thread/condition.hpp>
32 #include <boost/thread/xtime.hpp>
33 
34 #include <yaz/zgdu.h>
35 #include <yaz/log.h>
36 #include <yaz/otherinfo.h>
37 #include <yaz/diagbib1.h>
38 #include <yaz/oid_db.h>
39 #include <yaz/charneg.h>
40 
41 #include <yazpp/socket-manager.h>
42 #include <yazpp/pdu-assoc.h>
43 #include <yazpp/z-assoc.h>
44 
45 namespace mp = metaproxy_1;
46 namespace yf = mp::filter;
47 
48 namespace metaproxy_1 {
49  namespace filter {
50  class Z3950Client::Assoc : public yazpp_1::Z_Assoc{
51  friend class Rep;
52  Assoc(yazpp_1::SocketManager *socket_manager,
53  yazpp_1::IPDU_Observable *PDU_Observable,
54  std::string host, int connect_timeout,
55  int init_timeout, int max_sockets_timeout,
56  int general_timeout);
57  ~Assoc();
58  void connectNotify();
59  void failNotify();
60  void timeoutNotify();
61  void recv_GDU(Z_GDU *gdu, int len);
62  void fixup_nsd(ODR odr, Z_Records *records);
63  void fixup_nsd(ODR odr, Z_DefaultDiagFormat *nsd);
64  void fixup_init(ODR odr, Z_InitResponse *initrs);
65  yazpp_1::IPDU_Observer* sessionNotify(
66  yazpp_1::IPDU_Observable *the_PDU_Observable,
67  int fd);
68 
69  yazpp_1::SocketManager *m_socket_manager;
70  yazpp_1::IPDU_Observable *m_PDU_Observable;
71  Package *m_package;
72  bool m_in_use;
73  bool m_waiting;
75  int m_connected; // 0=not connected, 1=init phase, 2=rest
83  std::string m_host;
84  };
85 
87  public:
88  // number of seconds to wait before we give up request
97  std::string m_charset;
98  std::string m_default_target;
99  std::string m_force_target;
100  boost::mutex m_mutex;
101  boost::condition m_cond_session_ready;
102  std::map<mp::Session,Z3950Client::Assoc *> m_clients;
103  Z3950Client::Assoc *get_assoc(Package &package);
104  void send_and_receive(Package &package,
105  yf::Z3950Client::Assoc *c);
106  void release_assoc(Package &package);
107  };
108  }
109 }
110 
111 using namespace mp;
112 
113 yf::Z3950Client::Assoc::Assoc(yazpp_1::SocketManager *socket_manager,
114  yazpp_1::IPDU_Observable *PDU_Observable,
115  std::string host,
116  int connect_timeout,
117  int init_timeout, int max_sockets_timeout,
118  int general_timeout)
119  : Z_Assoc(PDU_Observable),
120  m_socket_manager(socket_manager), m_PDU_Observable(PDU_Observable),
121  m_package(0), m_in_use(true), m_waiting(false),
122  m_destroyed(false), m_connected(0), m_has_closed(false),
123  m_queue_len(1),
124  m_time_elapsed(0),
125  m_connect_time_max(connect_timeout),
126  m_init_time_max(init_timeout),
127  m_max_sockets_timeout_sec(max_sockets_timeout),
128  m_general_time_max(general_timeout),
129  m_host(host)
130 {
131  // std::cout << "create assoc " << this << "\n";
132 }
133 
134 yf::Z3950Client::Assoc::~Assoc()
135 {
136  // std::cout << "destroy assoc " << this << "\n";
137 }
138 
139 void yf::Z3950Client::Assoc::connectNotify()
140 {
141  m_waiting = false;
142 
143  m_connected = 1;
144 }
145 
146 void yf::Z3950Client::Assoc::failNotify()
147 {
148  m_waiting = false;
149 
150  mp::odr odr;
151 
152  if (m_package)
153  {
154  Z_GDU *gdu = m_package->request().get();
155  Z_APDU *apdu = 0;
156  if (gdu && gdu->which == Z_GDU_Z3950)
157  apdu = gdu->u.z3950;
158 
159  m_package->response() = odr.create_close(apdu, Z_Close_peerAbort, 0);
160  m_package->session().close();
161  }
162 }
163 
164 void yf::Z3950Client::Assoc::timeoutNotify()
165 {
166  m_time_elapsed++;
167  if ((m_connected == 0 && m_time_elapsed >= m_connect_time_max)
168  || (m_connected == 1 && m_time_elapsed >= m_init_time_max)
169  || (m_connected >= 2 && m_time_elapsed >= m_general_time_max))
170  {
171  m_waiting = false;
172 
173  mp::odr odr;
174 
175  if (m_package)
176  {
177  Z_GDU *gdu = m_package->request().get();
178  Z_APDU *apdu = 0;
179  if (gdu && gdu->which == Z_GDU_Z3950)
180  apdu = gdu->u.z3950;
181 
182  if (m_connected == 2)
183  m_package->response() =
184  odr.create_close(apdu, Z_Close_lackOfActivity, 0);
185  else
186  m_package->response() =
187  odr.create_close(apdu, Z_Close_peerAbort, 0);
188 
189  m_package->session().close();
190  }
191  }
192 }
193 
194 void yf::Z3950Client::Assoc::fixup_nsd(ODR odr, Z_DefaultDiagFormat *nsd)
195 {
196  std::string addinfo;
197 
198  // should really check for nsd->which.. But union has two members
199  // containing almost same data
200  const char *v2Addinfo = nsd->u.v2Addinfo;
201  // Z_InternationalString *v3Addinfo;
202  if (v2Addinfo && *v2Addinfo)
203  {
204  addinfo.assign(nsd->u.v2Addinfo);
205  addinfo += " ";
206  }
207  addinfo += "(backend=" + m_host + ")";
208  nsd->u.v2Addinfo = odr_strdup(odr, addinfo.c_str());
209 }
210 
211 void yf::Z3950Client::Assoc::fixup_nsd(ODR odr, Z_Records *records)
212 {
213  if (records && records->which == Z_Records_NSD)
214  {
215  fixup_nsd(odr, records->u.nonSurrogateDiagnostic);
216  }
217  if (records && records->which == Z_Records_multipleNSD)
218  {
219  Z_DiagRecs *drecs = records->u.multipleNonSurDiagnostics;
220  int i;
221  for (i = 0; i < drecs->num_diagRecs; i++)
222  {
223  Z_DiagRec *dr = drecs->diagRecs[i];
224 
225  if (dr->which == Z_DiagRec_defaultFormat)
226  fixup_nsd(odr, dr->u.defaultFormat);
227  }
228  }
229 }
230 
231 void yf::Z3950Client::Assoc::fixup_init(ODR odr, Z_InitResponse *initrs)
232 {
233  Z_External *uif = initrs->userInformationField;
234 
235  if (uif && uif->which == Z_External_userInfo1)
236  {
237  Z_OtherInformation *ui = uif->u.userInfo1;
238  int i;
239  for (i = 0; i < ui->num_elements; i++)
240  {
241  Z_OtherInformationUnit *unit = ui->list[i];
242  if (unit->which == Z_OtherInfo_externallyDefinedInfo &&
243  unit->information.externallyDefinedInfo &&
244  unit->information.externallyDefinedInfo->which ==
245  Z_External_diag1)
246  {
247  Z_DiagnosticFormat *diag =
248  unit->information.externallyDefinedInfo->u.diag1;
249  int j;
250  for (j = 0; j < diag->num; j++)
251  {
252  Z_DiagnosticFormat_s *ds = diag->elements[j];
253  if (ds->which == Z_DiagnosticFormat_s_defaultDiagRec)
254  {
255  Z_DefaultDiagFormat *r = ds->u.defaultDiagRec;
256  char *oaddinfo = r->u.v2Addinfo;
257  char *naddinfo = (char *) odr_malloc(
258  odr,
259  (oaddinfo ? strlen(oaddinfo) : 0) + 20 +
260  m_host.length());
261  *naddinfo = '\0';
262  if (oaddinfo && *oaddinfo)
263  {
264  strcat(naddinfo, oaddinfo);
265  strcat(naddinfo, " ");
266  }
267  strcat(naddinfo, "(backend=");
268  strcat(naddinfo, m_host.c_str());
269  strcat(naddinfo, ")");
270 
271  r->u.v2Addinfo = naddinfo;
272  }
273  }
274  }
275  }
276  }
277 }
278 
279 void yf::Z3950Client::Assoc::recv_GDU(Z_GDU *gdu, int len)
280 {
281  m_waiting = false;
282 
283  if (m_package)
284  {
285  mp::odr odr; // must be in scope for response() = assignment
286  if (gdu && gdu->which == Z_GDU_Z3950)
287  {
288  Z_APDU *apdu = gdu->u.z3950;
289  switch (apdu->which)
290  {
291  case Z_APDU_searchResponse:
292  fixup_nsd(odr, apdu->u.searchResponse->records);
293  break;
294  case Z_APDU_presentResponse:
295  fixup_nsd(odr, apdu->u.presentResponse->records);
296  break;
297  case Z_APDU_initResponse:
298  fixup_init(odr, apdu->u.initResponse);
299  m_connected = 2;
300  break;
301  }
302  }
303  m_package->response() = gdu;
304  }
305 }
306 
307 yazpp_1::IPDU_Observer *yf::Z3950Client::Assoc::sessionNotify(
308  yazpp_1::IPDU_Observable *the_PDU_Observable,
309  int fd)
310 {
311  return 0;
312 }
313 
314 
315 yf::Z3950Client::Z3950Client() : m_p(new yf::Z3950Client::Rep)
316 {
317  m_p->m_connect_timeout_sec = 10;
318  m_p->m_init_timeout_sec = 10;
319  m_p->m_general_timeout_sec = 30;
320  m_p->m_max_sockets = 0;
321  m_p->m_force_close = false;
322  m_p->m_client_ip = false;
323  m_p->m_bind_host = false;
324 }
325 
326 yf::Z3950Client::~Z3950Client() {
327 }
328 
329 yf::Z3950Client::Assoc *yf::Z3950Client::Rep::get_assoc(Package &package)
330 {
331  // only one thread messes with the clients list at a time
332  boost::mutex::scoped_lock lock(m_mutex);
333 
334  std::map<mp::Session,yf::Z3950Client::Assoc *>::iterator it;
335 
336  Z_GDU *gdu = package.request().get();
337 
338  int max_sockets = package.origin().get_max_sockets();
339  if (max_sockets == 0)
340  max_sockets = m_max_sockets;
341 
342  it = m_clients.find(package.session());
343  if (it != m_clients.end())
344  {
345  it->second->m_queue_len++;
346  while (true)
347  {
348 #if 0
349  // double init .. NOT working yet
350  if (gdu && gdu->which == Z_GDU_Z3950 &&
351  gdu->u.z3950->which == Z_APDU_initRequest)
352  {
353  yazpp_1::SocketManager *s = it->second->m_socket_manager;
354  delete it->second; // destroy Z_Assoc
355  delete s; // then manager
356  m_clients.erase(it);
357  break;
358  }
359 #endif
360  if (!it->second->m_in_use)
361  {
362  it->second->m_in_use = true;
363  return it->second;
364  }
365  m_cond_session_ready.wait(lock);
366  }
367  }
368  if (!gdu || gdu->which != Z_GDU_Z3950)
369  {
370  package.move();
371  return 0;
372  }
373  // new Z39.50 session ..
374  Z_APDU *apdu = gdu->u.z3950;
375  // check that it is init. If not, close
376  if (apdu->which != Z_APDU_initRequest)
377  {
378  mp::odr odr;
379 
380  package.response() = odr.create_close(apdu,
381  Z_Close_protocolError,
382  "First PDU was not an "
383  "Initialize Request");
384  package.session().close();
385  return 0;
386  }
387  std::string target = m_force_target;
388  if (!target.length())
389  {
390  target = m_default_target;
391  std::list<std::string> vhosts;
392  mp::util::remove_vhost_otherinfo(&apdu->u.initRequest->otherInfo,
393  vhosts);
394  size_t no_vhosts = vhosts.size();
395  if (no_vhosts == 1)
396  {
397  std::list<std::string>::const_iterator v_it = vhosts.begin();
398  target = *v_it;
399  }
400  else if (no_vhosts == 0)
401  {
402  if (!target.length())
403  {
404  // no default target. So we don't know where to connect
405  mp::odr odr;
406  package.response() = odr.create_initResponse(
407  apdu,
408  YAZ_BIB1_INIT_NEGOTIATION_OPTION_REQUIRED,
409  "z3950_client: No vhost given");
410 
411  package.session().close();
412  return 0;
413  }
414  }
415  else if (no_vhosts > 1)
416  {
417  mp::odr odr;
418  package.response() = odr.create_initResponse(
419  apdu,
420  YAZ_BIB1_COMBI_OF_SPECIFIED_DATABASES_UNSUPP,
421  "z3950_client: Can not cope with multiple vhosts");
422  package.session().close();
423  return 0;
424  }
425  }
426 
427  // see if we have reached max number of clients (max-sockets)
428  boost::xtime xt;
429  xtime_get(&xt,
430 #if BOOST_VERSION >= 105000
431  boost::TIME_UTC_
432 #else
433  boost::TIME_UTC
434 #endif
435  );
436  xt.sec += m_max_sockets_timeout_sec;
437  while (max_sockets)
438  {
439  int no_not_in_use = 0;
440  int number = 0;
441  it = m_clients.begin();
442  for (; it != m_clients.end(); it++)
443  {
444  yf::Z3950Client::Assoc *as = it->second;
445  if (!strcmp(as->m_host.c_str(), target.c_str()))
446  {
447  number++;
448  if (!as->m_in_use)
449  no_not_in_use++;
450  }
451  }
452  yaz_log(YLOG_LOG, "Found %d/%d connections for %s", number, max_sockets,
453  target.c_str());
454  if (number < max_sockets)
455  break;
456  if (no_not_in_use == 0) // all in use..
457  {
458  mp::odr odr;
459 
460  package.response() = odr.create_initResponse(
461  apdu, YAZ_BIB1_TEMPORARY_SYSTEM_ERROR,
462  "z3950_client: max sessions");
463  package.session().close();
464  return 0;
465  }
466  if (!m_cond_session_ready.timed_wait(lock, xt))
467  {
468  mp::odr odr;
469 
470  package.response() = odr.create_initResponse(
471  apdu, YAZ_BIB1_TEMPORARY_SYSTEM_ERROR,
472  "z3950_client: max sessions");
473  package.session().close();
474  return 0;
475  }
476  }
477 
478  yazpp_1::SocketManager *sm = new yazpp_1::SocketManager;
479  yazpp_1::PDU_Assoc *pdu_as = new yazpp_1::PDU_Assoc(sm);
480  yf::Z3950Client::Assoc *as =
481  new yf::Z3950Client::Assoc(sm, pdu_as, target.c_str(),
486  m_clients[package.session()] = as;
487  return as;
488 }
489 
490 static void set_charset_proposal(ODR odr, Z_InitRequest *req, const char *charset)
491 {
492  Z_OtherInformation **p = &req->otherInfo;
493  Z_OtherInformationUnit *oi;
494 
495  if (*p)
496  {
497  int i;
498  for (i = 0; i < (*p)->num_elements; i++)
499  {
500  Z_External *ext = (*p)->list[i]->information.externallyDefinedInfo;
501  if ((*p)->list[i]->which == Z_OtherInfo_externallyDefinedInfo
502  && ext &&
503  ext->which == Z_External_charSetandLanguageNegotiation)
504  return;
505  }
506  }
507  if ((oi = yaz_oi_update(p, odr, 0, 0, 0)))
508  {
509  ODR_MASK_SET(req->options, Z_Options_negotiationModel);
510  oi->which = Z_OtherInfo_externallyDefinedInfo;
511  oi->information.externallyDefinedInfo =
512  yaz_set_proposal_charneg_list(odr, ",",
513  charset,
514  0 /* lang */,
515  1 /* records included */);
516  }
517 }
518 
519 void yf::Z3950Client::Rep::send_and_receive(Package &package,
520  yf::Z3950Client::Assoc *c)
521 {
522  if (c->m_destroyed)
523  return;
524 
525  c->m_package = &package;
526 
527  if (package.session().is_closed() && c->m_connected && !c->m_has_closed
528  && m_force_close)
529  {
530  mp::odr odr;
531 
532  package.request() = odr.create_close(
533  0, Z_Close_finished, "z3950_client");
534  c->m_package = 0; // don't inspect response
535  }
536  Z_GDU *gdu = package.request().get();
537 
538  if (!gdu || gdu->which != Z_GDU_Z3950)
539  return;
540 
541  if (gdu->u.z3950->which == Z_APDU_close)
542  c->m_has_closed = true;
543 
544  Z_APDU *apdu = gdu->u.z3950;
545 
546  // prepare connect
547  c->m_time_elapsed = 0;
548  c->m_waiting = true;
549  if (!c->m_connected)
550  {
551  std::string host(c->m_host);
552 
553  if (m_bind_host)
554  {
555  std::string bind_host = package.origin().get_bind_address();
556  if (bind_host.length())
557  {
558  host.append(" ");
559  host.append(bind_host);
560  }
561  }
562  if (c->client(host.c_str()))
563  {
564  mp::odr odr;
565  package.response() =
566  odr.create_close(gdu->u.z3950, Z_Close_peerAbort, 0);
567  package.session().close();
568  return;
569  }
570  c->timeout(1); // so timeoutNotify gets called once per second
571 
572 
573  while (!c->m_destroyed && c->m_waiting
574  && c->m_socket_manager->processEvent() > 0)
575  ;
576  }
577  if (!c->m_connected)
578  {
579  return;
580  }
581  mp::odr odr;
582  if (m_client_ip)
583  {
584  std::string peer_name2 = package.origin().get_address();
585  if (apdu->which == Z_APDU_initRequest && peer_name2.length())
586  {
587  Z_OtherInformation **oi = &apdu->u.initRequest->otherInfo;
588  char *peer_name1 =
589  yaz_oi_get_string_oid(oi, yaz_oid_userinfo_client_ip, 1, 1);
590  std::string pcomb;
591  if (peer_name1)
592  {
593  pcomb.append(peer_name1);
594  pcomb.append(", ");
595  }
596  pcomb.append(peer_name2);
597  yaz_oi_set_string_oid(&apdu->u.initRequest->otherInfo,
598  odr, yaz_oid_userinfo_client_ip,
599  1, pcomb.c_str());
600  }
601  }
602  if (apdu->which == Z_APDU_initRequest && m_charset.length() > 0)
603  set_charset_proposal(odr, apdu->u.initRequest, m_charset.c_str());
604 
605  // prepare response
606  c->m_time_elapsed = 0;
607  c->m_waiting = true;
608 
609  // relay the package ..
610  int len;
611  c->send_GDU(gdu, &len);
612 
613  switch (gdu->u.z3950->which)
614  {
615  case Z_APDU_triggerResourceControlRequest:
616  // request only..
617  break;
618  default:
619  // for the rest: wait for a response PDU
620  while (!c->m_destroyed && c->m_waiting
621  && c->m_socket_manager->processEvent() > 0)
622  ;
623  break;
624  }
625 }
626 
627 void yf::Z3950Client::Rep::release_assoc(Package &package)
628 {
629  boost::mutex::scoped_lock lock(m_mutex);
630  std::map<mp::Session,yf::Z3950Client::Assoc *>::iterator it;
631 
632  it = m_clients.find(package.session());
633  if (it != m_clients.end())
634  {
635  it->second->m_in_use = false;
636  it->second->m_queue_len--;
637 
638  if (package.session().is_closed())
639  {
640  // destroy hint (send_and_receive)
641  it->second->m_destroyed = true;
642  if (it->second->m_queue_len == 0)
643  {
644  yazpp_1::SocketManager *s = it->second->m_socket_manager;
645  delete it->second; // destroy Z_Assoc
646  delete s; // then manager
647  m_clients.erase(it);
648  }
649  }
650  m_cond_session_ready.notify_all();
651  }
652 }
653 
654 void yf::Z3950Client::process(Package &package) const
655 {
656  yf::Z3950Client::Assoc *c = m_p->get_assoc(package);
657  if (c)
658  {
659  m_p->send_and_receive(package, c);
660  m_p->release_assoc(package);
661  }
662 }
663 
664 void yf::Z3950Client::configure(const xmlNode *ptr, bool test_only,
665  const char *path)
666 {
667  for (ptr = ptr->children; ptr; ptr = ptr->next)
668  {
669  if (ptr->type != XML_ELEMENT_NODE)
670  continue;
671  if (!strcmp((const char *) ptr->name, "timeout"))
672  {
673  m_p->m_general_timeout_sec = mp::xml::get_int(ptr, 30);
674  }
675  else if (!strcmp((const char *) ptr->name, "connect-timeout"))
676  {
677  m_p->m_connect_timeout_sec = mp::xml::get_int(ptr, 10);
678  }
679  else if (!strcmp((const char *) ptr->name, "init-timeout"))
680  {
681  m_p->m_init_timeout_sec = mp::xml::get_int(ptr, 10);
682  }
683  else if (!strcmp((const char *) ptr->name, "max-sockets-timeout"))
684  {
685  m_p->m_max_sockets_timeout_sec = mp::xml::get_int(ptr, 15);
686  }
687  else if (!strcmp((const char *) ptr->name, "default_target"))
688  {
689  m_p->m_default_target = mp::xml::get_text(ptr);
690  }
691  else if (!strcmp((const char *) ptr->name, "force_target"))
692  {
693  m_p->m_force_target = mp::xml::get_text(ptr);
694  }
695  else if (!strcmp((const char *) ptr->name, "max-sockets"))
696  {
697  m_p->m_max_sockets = mp::xml::get_int(ptr, 0);
698  }
699  else if (!strcmp((const char *) ptr->name, "force_close"))
700  {
701  m_p->m_force_close = mp::xml::get_bool(ptr, 0);
702  }
703  else if (!strcmp((const char *) ptr->name, "client_ip"))
704  {
705  m_p->m_client_ip = mp::xml::get_bool(ptr, 0);
706  }
707  else if (!strcmp((const char *) ptr->name, "charset"))
708  {
709  m_p->m_charset = mp::xml::get_text(ptr);
710  }
711  else if (!strcmp((const char *) ptr->name, "bind_host"))
712  {
713  m_p->m_bind_host = mp::xml::get_bool(ptr, 0);
714  }
715  else
716  {
717  throw mp::filter::FilterException("Bad element "
718  + std::string((const char *)
719  ptr->name));
720  }
721  }
722 }
723 
724 static mp::filter::Base* filter_creator()
725 {
726  return new mp::filter::Z3950Client;
727 }
728 
729 extern "C" {
730  struct metaproxy_1_filter_struct metaproxy_1_filter_z3950_client = {
731  0,
732  "z3950_client",
734  };
735 }
736 
737 /*
738  * Local variables:
739  * c-basic-offset: 4
740  * c-file-style: "Stroustrup"
741  * indent-tabs-mode: nil
742  * End:
743  * vim: shiftwidth=4 tabstop=8 expandtab
744  */
745 
Assoc(yazpp_1::SocketManager *socket_manager, yazpp_1::IPDU_Observable *PDU_Observable, std::string host, int connect_timeout, int init_timeout, int max_sockets_timeout, int general_timeout)
yazpp_1::IPDU_Observer * sessionNotify(yazpp_1::IPDU_Observable *the_PDU_Observable, int fd)
static void set_charset_proposal(ODR odr, Z_InitRequest *req, const char *charset)
void recv_GDU(Z_GDU *gdu, int len)
static mp::filter::Base * filter_creator()
void fixup_nsd(ODR odr, Z_Records *records)
void fixup_init(ODR odr, Z_InitResponse *initrs)
std::map< mp::Session, Z3950Client::Assoc * > m_clients
struct metaproxy_1_filter_struct metaproxy_1_filter_z3950_client