X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=ztest%2Fztest.c;h=77a600d020648949c55a82f69c55294803ae724d;hp=e6595702d0e932be8dd7e2379aae8c8f25c450b6;hb=2ede0bb278b22c8ce1cdd48e9a11a5924d433763;hpb=d57ade59211707b9bcfacc61039e446c9fa3f36f diff --git a/ztest/ztest.c b/ztest/ztest.c index e659570..77a600d 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: ztest.c,v 1.79 2006-04-21 10:28:09 adam Exp $ + * $Id: ztest.c,v 1.83 2006-12-06 21:35:59 adam Exp $ */ /* @@ -54,7 +54,17 @@ int ztest_search(void *handle, bend_search_rr *rr) else if(!yaz_matchstr (rr->basenames[0], "Slow")) { #if HAVE_UNISTD_H - sleep(3); + /* wait up to 3 seconds and check if connection is still alive */ + int i; + for (i = 0; i<3; i++) + { + if (!bend_assoc_is_alive(rr->association)) + { + yaz_log(YLOG_LOG, "search aborted"); + break; + } + sleep(1); + } #endif ; } @@ -663,6 +673,12 @@ int ztest_explain(void *handle, bend_explain_rr *rr) return 0; } +int ztest_update(void *handle, bend_update_rr *rr) +{ + rr->operation_status = "success"; + return 0; +} + bend_initresult *bend_init(bend_initrequest *q) { bend_initresult *r = (bend_initresult *) @@ -690,6 +706,7 @@ bend_initresult *bend_init(bend_initrequest *q) q->bend_explain = ztest_explain; #endif q->bend_srw_scan = ztest_scan; + q->bend_srw_update = ztest_update; return r; }