X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=ztest%2Fztest.c;h=bf8e82a93147180f0355f7ff73aad6fe6e7790c1;hp=541ed73f7fd3f424bafc248700eae61005a636f4;hb=ee6ab2ee3a9ee1a8c65d7272ec7fba1d886f5af0;hpb=16895949a4bd1a0cc5c25b0642cb0c7a1e47ff12 diff --git a/ztest/ztest.c b/ztest/ztest.c index 541ed73..bf8e82a 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data * See the file LICENSE for details. - * - * $Id: ztest.c,v 1.93 2007-06-11 08:50:57 adam Exp $ */ /* @@ -153,6 +151,7 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) Z_IORequest *ir = it->u.esRequest; Z_IOOriginPartToKeep *k = ir->toKeep; Z_IOOriginPartNotToKeep *n = ir->notToKeep; + const char *xml_in_response = 0; if (k && k->contact) { @@ -192,8 +191,10 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) { yaz_log (log_level, "ILL XML request"); if (r->which == Z_External_octet) - yaz_log (log_level, "%.*s", r->u.octet_aligned->len, + yaz_log (log_level, "%.*s", + r->u.octet_aligned->len, r->u.octet_aligned->buf); + xml_in_response = "x"; } if (!oid_oidcmp(r->direct_reference, yaz_oid_general_isoill_1)) @@ -300,7 +301,13 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) ext->u.itemOrder->u.taskPackage->originPart = k; ext->u.itemOrder->u.taskPackage->targetPart = targetPart; - targetPart->itemRequest = 0; + if (xml_in_response) + targetPart->itemRequest = + z_ext_record_xml(rr->stream, xml_in_response, + strlen(xml_in_response)); + else + targetPart->itemRequest = 0; + targetPart->statusOrErrorReport = 0; targetPart->auxiliaryStatus = 0; } @@ -504,17 +511,12 @@ int ztest_present (void *handle, bend_present_rr *rr) int ztest_fetch(void *handle, bend_fetch_rr *r) { char *cp; - oid_class oclass; - char oid_str_buf[OID_STR_MAX]; - const char *oid_str = 0; const Odr_oid *oid = r->request_format; r->last_in_set = 0; r->basename = "Default"; r->output_format = r->request_format; - oid_str = yaz_oid_to_string_buf(oid, &oclass, oid_str_buf); - if (oid && !oid_oidcmp(oid, yaz_oid_recsyn_sutrs)) { /* this section returns a small record */