- {
- yp2::RouterChain router;
-
- yp2::filter::Log lf;
- FilterBounceInit bf;
-
- router.rule(lf);
- router.rule(bf);
-
- // Create package with Z39.50 init request in it
- yp2::Package pack;
-
- ODR odr = odr_createmem(ODR_ENCODE);
- Z_APDU *apdu = zget_APDU(odr, Z_APDU_initRequest);
-
- pack.request() = apdu;
- odr_destroy(odr);
- // Done creating query.
-
- // Put it in router
- pack.router(router).move();
-
- // Inspect that we got Z39.50 init response
- yazpp_1::GDU *gdu = &pack.response();
-
- Z_GDU *z_gdu = gdu->get();
- BOOST_CHECK(z_gdu);
- if (z_gdu) {
- BOOST_CHECK_EQUAL(z_gdu->which, Z_GDU_Z3950);
- BOOST_CHECK_EQUAL(z_gdu->u.z3950->which, Z_APDU_initResponse);
- }
+ yp2::RouterChain router;
+
+ yp2::filter::Log lf;
+ FilterBounceInit bf;
+
+ router.append(lf);
+ router.append(bf);
+
+ // Create package with Z39.50 init request in it
+ yp2::Package pack;
+
+ yp2::odr odr;
+ Z_APDU *apdu = zget_APDU(odr, Z_APDU_initRequest);
+
+ pack.request() = apdu;
+ // Done creating query.
+
+ // Put it in router
+ pack.router(router).move();
+
+ // Inspect that we got Z39.50 init response
+ yazpp_1::GDU *gdu = &pack.response();
+
+ Z_GDU *z_gdu = gdu->get();
+ BOOST_CHECK(z_gdu);
+ if (z_gdu) {
+ BOOST_CHECK_EQUAL(z_gdu->which, Z_GDU_Z3950);
+ BOOST_CHECK_EQUAL(z_gdu->u.z3950->which, Z_APDU_initResponse);