X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ztest%2Fztest.c;h=fa749d6cd3d08c6d73c04eb45b0f5f3ab8edaadc;hb=8e4eabe621f8b8195faa6625a38a2e1ae7b68aa1;hp=cae11694d46f3d1b1856ab37a40fe6bafc4f6ea3;hpb=7acd51b7cdffca5ad92a777d2c6e8e9bae1f9fd3;p=yaz-moved-to-github.git diff --git a/ztest/ztest.c b/ztest/ztest.c index cae1169..fa749d6 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -6,7 +6,16 @@ * Chas Woodfield, Fretwell Downing Datasystems. * * $Log: ztest.c,v $ - * Revision 1.32 2000-04-05 07:39:55 adam + * Revision 1.35 2000-11-23 10:58:33 adam + * SSL comstack support. Separate POSIX thread support library. + * + * Revision 1.34 2000/09/04 08:58:15 adam + * Added prefix yaz_ for most logging utility functions. + * + * Revision 1.33 2000/08/10 08:41:26 adam + * Fixes for ILL. + * + * Revision 1.32 2000/04/05 07:39:55 adam * Added shared library support (libtool). * * Revision 1.31 2000/01/31 13:15:21 adam @@ -201,7 +210,7 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) yaz_log(LOG_LOG, "OID %s", ent->desc); if (ent && ent->value == VAL_ISO_ILL_1) { - yaz_log (LOG_LOG, "ItemRequest"); + yaz_log (LOG_LOG, "Decode ItemRequest begin"); if (r->which == ODR_EXTERNAL_single) { odr_setbuf(rr->decode, @@ -214,11 +223,15 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) "Couldn't decode ItemRequest %s near %d", odr_errmsg(odr_geterror(rr->decode)), odr_offset(rr->decode)); +#if 0 yaz_log(LOG_LOG, "PDU dump:"); - odr_dumpBER(log_file(), + odr_dumpBER(yaz_log_file(), r->u.single_ASN1_type->buf, r->u.single_ASN1_type->len); +#endif } + else + yaz_log(LOG_LOG, "Decode ItemRequest OK"); if (rr->print) { ill_ItemRequest (rr->print, &item_req, 0, @@ -228,7 +241,7 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) } if (!item_req && r->which == ODR_EXTERNAL_single) { - yaz_log (LOG_LOG, "ILLRequest"); + yaz_log (LOG_LOG, "Decode ILLRequest begin"); odr_setbuf(rr->decode, r->u.single_ASN1_type->buf, r->u.single_ASN1_type->len, 0); @@ -240,10 +253,12 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) odr_errmsg(odr_geterror(rr->decode)), odr_offset(rr->decode)); yaz_log(LOG_LOG, "PDU dump:"); - odr_dumpBER(log_file(), + odr_dumpBER(yaz_log_file(), r->u.single_ASN1_type->buf, r->u.single_ASN1_type->len); } + else + yaz_log(LOG_LOG, "Decode ILLRequest OK"); if (rr->print) { ill_Request (rr->print, &ill_req, 0, @@ -466,12 +481,21 @@ int ztest_fetch(void *handle, bend_fetch_rr *r) r->output_format = r->request_format; if (r->request_format == VAL_SUTRS) { +#if 0 +/* this section returns a huge record (for testing non-blocking write, etc) */ + r->len = 980000; + r->record = odr_malloc (r->stream, r->len); + memset (r->record, 'x', r->len); +#else +/* this section returns a small record */ char buf[100]; sprintf(buf, "This is dummy SUTRS record number %d\n", r->number); + r->len = strlen(buf); r->record = (char *) odr_malloc (r->stream, r->len+1); strcpy(r->record, buf); +#endif } else if (r->request_format == VAL_GRS1) {