metaproxy  1.21.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_max_sockets_timeout_sec = 15;
322  m_p->m_force_close = false;
323  m_p->m_client_ip = false;
324  m_p->m_bind_host = false;
325 }
326 
327 yf::Z3950Client::~Z3950Client() {
328 }
329 
330 yf::Z3950Client::Assoc *yf::Z3950Client::Rep::get_assoc(Package &package)
331 {
332  // only one thread messes with the clients list at a time
333  boost::mutex::scoped_lock lock(m_mutex);
334 
335  std::map<mp::Session,yf::Z3950Client::Assoc *>::iterator it;
336 
337  Z_GDU *gdu = package.request().get();
338 
339  int max_sockets = package.origin().get_max_sockets();
340  if (max_sockets == 0)
341  max_sockets = m_max_sockets;
342 
343  it = m_clients.find(package.session());
344  if (it != m_clients.end())
345  {
346  it->second->m_queue_len++;
347  while (true)
348  {
349 #if 0
350  // double init .. NOT working yet
351  if (gdu && gdu->which == Z_GDU_Z3950 &&
352  gdu->u.z3950->which == Z_APDU_initRequest)
353  {
354  yazpp_1::SocketManager *s = it->second->m_socket_manager;
355  delete it->second; // destroy Z_Assoc
356  delete s; // then manager
357  m_clients.erase(it);
358  break;
359  }
360 #endif
361  if (!it->second->m_in_use)
362  {
363  it->second->m_in_use = true;
364  return it->second;
365  }
366  m_cond_session_ready.wait(lock);
367  }
368  }
369  if (!gdu || gdu->which != Z_GDU_Z3950)
370  {
371  package.move();
372  return 0;
373  }
374  // new Z39.50 session ..
375  Z_APDU *apdu = gdu->u.z3950;
376  // check that it is init. If not, close
377  if (apdu->which != Z_APDU_initRequest)
378  {
379  mp::odr odr;
380 
381  package.response() = odr.create_close(apdu,
382  Z_Close_protocolError,
383  "First PDU was not an "
384  "Initialize Request");
385  package.session().close();
386  return 0;
387  }
388  std::string target = m_force_target;
389  if (!target.length())
390  {
391  target = m_default_target;
392  std::list<std::string> vhosts;
393  mp::util::remove_vhost_otherinfo(&apdu->u.initRequest->otherInfo,
394  vhosts);
395  size_t no_vhosts = vhosts.size();
396  if (no_vhosts == 1)
397  {
398  std::list<std::string>::const_iterator v_it = vhosts.begin();
399  target = *v_it;
400  }
401  else if (no_vhosts == 0)
402  {
403  if (!target.length())
404  {
405  // no default target. So we don't know where to connect
406  mp::odr odr;
407  package.response() = odr.create_initResponse(
408  apdu,
409  YAZ_BIB1_INIT_NEGOTIATION_OPTION_REQUIRED,
410  "z3950_client: No vhost given");
411 
412  package.session().close();
413  return 0;
414  }
415  }
416  else if (no_vhosts > 1)
417  {
418  mp::odr odr;
419  package.response() = odr.create_initResponse(
420  apdu,
421  YAZ_BIB1_COMBI_OF_SPECIFIED_DATABASES_UNSUPP,
422  "z3950_client: Can not cope with multiple vhosts");
423  package.session().close();
424  return 0;
425  }
426  }
427 
428  // see if we have reached max number of clients (max-sockets)
429  boost::xtime xt;
430  xtime_get(&xt,
431 #if BOOST_VERSION >= 105000
432  boost::TIME_UTC_
433 #else
434  boost::TIME_UTC
435 #endif
436  );
437  xt.sec += m_max_sockets_timeout_sec;
438  while (max_sockets)
439  {
440  int no_not_in_use = 0;
441  int number = 0;
442  it = m_clients.begin();
443  for (; it != m_clients.end(); it++)
444  {
445  yf::Z3950Client::Assoc *as = it->second;
446  if (!strcmp(as->m_host.c_str(), target.c_str()))
447  {
448  number++;
449  if (!as->m_in_use)
450  no_not_in_use++;
451  }
452  }
453  yaz_log(YLOG_LOG, "Found num=%d/max=%d/idle=%d connections for %s",
454  number, max_sockets, no_not_in_use, target.c_str());
455  if (number < max_sockets)
456  break;
457  if (no_not_in_use == 0) // all in use..
458  {
459  mp::odr odr;
460 
461  package.response() = odr.create_initResponse(
462  apdu, YAZ_BIB1_TEMPORARY_SYSTEM_ERROR,
463  "z3950_client: max sessions");
464  package.session().close();
465  return 0;
466  }
467  if (!m_cond_session_ready.timed_wait(lock, xt))
468  {
469  mp::odr odr;
470 
471  package.response() = odr.create_initResponse(
472  apdu, YAZ_BIB1_TEMPORARY_SYSTEM_ERROR,
473  "z3950_client: max sessions");
474  package.session().close();
475  return 0;
476  }
477  }
478 
479  yazpp_1::SocketManager *sm = new yazpp_1::SocketManager;
480  yazpp_1::PDU_Assoc *pdu_as = new yazpp_1::PDU_Assoc(sm);
481  yf::Z3950Client::Assoc *as =
482  new yf::Z3950Client::Assoc(sm, pdu_as, target.c_str(),
483  m_connect_timeout_sec,
484  m_init_timeout_sec,
485  m_max_sockets_timeout_sec,
486  m_general_timeout_sec);
487  m_clients[package.session()] = as;
488  return as;
489 }
490 
491 static void set_charset_proposal(ODR odr, Z_InitRequest *req, const char *charset)
492 {
493  Z_OtherInformation **p = &req->otherInfo;
494  Z_OtherInformationUnit *oi;
495 
496  if (*p)
497  {
498  int i;
499  for (i = 0; i < (*p)->num_elements; i++)
500  {
501  Z_External *ext = (*p)->list[i]->information.externallyDefinedInfo;
502  if ((*p)->list[i]->which == Z_OtherInfo_externallyDefinedInfo
503  && ext &&
504  ext->which == Z_External_charSetandLanguageNegotiation)
505  return;
506  }
507  }
508  if ((oi = yaz_oi_update(p, odr, 0, 0, 0)))
509  {
510  ODR_MASK_SET(req->options, Z_Options_negotiationModel);
511  oi->which = Z_OtherInfo_externallyDefinedInfo;
512  oi->information.externallyDefinedInfo =
513  yaz_set_proposal_charneg_list(odr, ",",
514  charset,
515  0 /* lang */,
516  1 /* records included */);
517  }
518 }
519 
520 void yf::Z3950Client::Rep::send_and_receive(Package &package,
521  yf::Z3950Client::Assoc *c)
522 {
523  if (c->m_destroyed)
524  return;
525 
526  c->m_package = &package;
527 
528  if (package.session().is_closed() && c->m_connected && !c->m_has_closed
529  && m_force_close)
530  {
531  mp::odr odr;
532 
533  package.request() = odr.create_close(
534  0, Z_Close_finished, "z3950_client");
535  c->m_package = 0; // don't inspect response
536  }
537  Z_GDU *gdu = package.request().get();
538 
539  if (!gdu || gdu->which != Z_GDU_Z3950)
540  return;
541 
542  if (gdu->u.z3950->which == Z_APDU_close)
543  c->m_has_closed = true;
544 
545  Z_APDU *apdu = gdu->u.z3950;
546 
547  // prepare connect
548  c->m_time_elapsed = 0;
549  c->m_waiting = true;
550  if (!c->m_connected)
551  {
552  std::string host(c->m_host);
553 
554  if (m_bind_host)
555  {
556  std::string bind_host = package.origin().get_bind_address();
557  if (bind_host.length())
558  {
559  host.append(" ");
560  host.append(bind_host);
561  }
562  }
563  if (c->client(host.c_str()))
564  {
565  mp::odr odr;
566  package.response() =
567  odr.create_close(gdu->u.z3950, Z_Close_peerAbort, 0);
568  package.session().close();
569  return;
570  }
571  c->timeout(1); // so timeoutNotify gets called once per second
572 
573 
574  while (!c->m_destroyed && c->m_waiting
575  && c->m_socket_manager->processEvent() > 0)
576  ;
577  }
578  if (!c->m_connected)
579  {
580  return;
581  }
582  mp::odr odr;
583  if (m_client_ip)
584  {
585  std::string peer_name2 = package.origin().get_address();
586  if (apdu->which == Z_APDU_initRequest && peer_name2.length())
587  {
588  Z_OtherInformation **oi = &apdu->u.initRequest->otherInfo;
589  char *peer_name1 =
590  yaz_oi_get_string_oid(oi, yaz_oid_userinfo_client_ip, 1, 1);
591  std::string pcomb;
592  if (peer_name1)
593  {
594  pcomb.append(peer_name1);
595  pcomb.append(", ");
596  }
597  pcomb.append(peer_name2);
598  yaz_oi_set_string_oid(&apdu->u.initRequest->otherInfo,
599  odr, yaz_oid_userinfo_client_ip,
600  1, pcomb.c_str());
601  }
602  }
603  if (apdu->which == Z_APDU_initRequest && m_charset.length() > 0)
604  set_charset_proposal(odr, apdu->u.initRequest, m_charset.c_str());
605 
606  // prepare response
607  c->m_time_elapsed = 0;
608  c->m_waiting = true;
609 
610  // relay the package ..
611  int len;
612  c->send_GDU(gdu, &len);
613 
614  switch (gdu->u.z3950->which)
615  {
616  case Z_APDU_triggerResourceControlRequest:
617  // request only..
618  break;
619  default:
620  // for the rest: wait for a response PDU
621  while (!c->m_destroyed && c->m_waiting
622  && c->m_socket_manager->processEvent() > 0)
623  ;
624  break;
625  }
626 }
627 
628 void yf::Z3950Client::Rep::release_assoc(Package &package)
629 {
630  boost::mutex::scoped_lock lock(m_mutex);
631  std::map<mp::Session,yf::Z3950Client::Assoc *>::iterator it;
632 
633  it = m_clients.find(package.session());
634  if (it != m_clients.end())
635  {
636  it->second->m_in_use = false;
637  it->second->m_queue_len--;
638 
639  if (package.session().is_closed())
640  {
641  // destroy hint (send_and_receive)
642  it->second->m_destroyed = true;
643  if (it->second->m_queue_len == 0)
644  {
645  yazpp_1::SocketManager *s = it->second->m_socket_manager;
646  delete it->second; // destroy Z_Assoc
647  delete s; // then manager
648  m_clients.erase(it);
649  }
650  }
651  m_cond_session_ready.notify_all();
652  }
653 }
654 
655 void yf::Z3950Client::process(Package &package) const
656 {
657  yf::Z3950Client::Assoc *c = m_p->get_assoc(package);
658  if (c)
659  {
660  m_p->send_and_receive(package, c);
661  m_p->release_assoc(package);
662  }
663 }
664 
665 void yf::Z3950Client::configure(const xmlNode *ptr, bool test_only,
666  const char *path)
667 {
668  for (ptr = ptr->children; ptr; ptr = ptr->next)
669  {
670  if (ptr->type != XML_ELEMENT_NODE)
671  continue;
672  if (!strcmp((const char *) ptr->name, "timeout"))
673  {
674  m_p->m_general_timeout_sec = mp::xml::get_int(ptr, 30);
675  }
676  else if (!strcmp((const char *) ptr->name, "connect-timeout"))
677  {
678  m_p->m_connect_timeout_sec = mp::xml::get_int(ptr, 10);
679  }
680  else if (!strcmp((const char *) ptr->name, "init-timeout"))
681  {
682  m_p->m_init_timeout_sec = mp::xml::get_int(ptr, 10);
683  }
684  else if (!strcmp((const char *) ptr->name, "max-sockets-timeout"))
685  {
686  m_p->m_max_sockets_timeout_sec = mp::xml::get_int(ptr, 15);
687  }
688  else if (!strcmp((const char *) ptr->name, "default_target"))
689  {
690  m_p->m_default_target = mp::xml::get_text(ptr);
691  }
692  else if (!strcmp((const char *) ptr->name, "force_target"))
693  {
694  m_p->m_force_target = mp::xml::get_text(ptr);
695  }
696  else if (!strcmp((const char *) ptr->name, "max-sockets"))
697  {
698  m_p->m_max_sockets = mp::xml::get_int(ptr, 0);
699  }
700  else if (!strcmp((const char *) ptr->name, "force_close"))
701  {
702  m_p->m_force_close = mp::xml::get_bool(ptr, 0);
703  }
704  else if (!strcmp((const char *) ptr->name, "client_ip"))
705  {
706  m_p->m_client_ip = mp::xml::get_bool(ptr, 0);
707  }
708  else if (!strcmp((const char *) ptr->name, "charset"))
709  {
710  m_p->m_charset = mp::xml::get_text(ptr);
711  }
712  else if (!strcmp((const char *) ptr->name, "bind_host"))
713  {
714  m_p->m_bind_host = mp::xml::get_bool(ptr, 0);
715  }
716  else
717  {
718  throw mp::filter::FilterException("Bad element "
719  + std::string((const char *)
720  ptr->name));
721  }
722  }
723 }
724 
725 static mp::filter::Base* filter_creator()
726 {
727  return new mp::filter::Z3950Client;
728 }
729 
730 extern "C" {
731  struct metaproxy_1_filter_struct metaproxy_1_filter_z3950_client = {
732  0,
733  "z3950_client",
735  };
736 }
737 
738 /*
739  * Local variables:
740  * c-basic-offset: 4
741  * c-file-style: "Stroustrup"
742  * indent-tabs-mode: nil
743  * End:
744  * vim: shiftwidth=4 tabstop=8 expandtab
745  */
746 
void fixup_nsd(ODR odr, Z_Records *records)
void fixup_init(ODR odr, Z_InitResponse *initrs)
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)
void send_and_receive(Package &package, yf::Z3950Client::Assoc *c)
std::map< mp::Session, Z3950Client::Assoc * > m_clients
Z3950Client::Assoc * get_assoc(Package &package)
struct metaproxy_1_filter_struct metaproxy_1_filter_z3950_client
static void set_charset_proposal(ODR odr, Z_InitRequest *req, const char *charset)
static mp::filter::Base * filter_creator()