X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=ztest%2Fztest.c;h=515d1ac81a308199d71989439c265d5feb6ee080;hb=f6379872ace49628473c47d23b29e9f46b5afbe4;hp=29026a103b03928728faad07854d0b701412f670;hpb=9a931f88892b2d8be796bfafa07e430307b7c5f6;p=yaz-moved-to-github.git diff --git a/ztest/ztest.c b/ztest/ztest.c index 29026a1..515d1ac 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.80 2006-05-05 20:02:22 quinn Exp $ + * $Id: ztest.c,v 1.82 2006-12-04 14:56:55 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 ; } @@ -669,8 +679,6 @@ bend_initresult *bend_init(bend_initrequest *q) odr_malloc (q->stream, sizeof(*r)); int *counter = (int *) xmalloc (sizeof(int)); - fprintf(stderr, "FUK\n"); - if (!log_level_set) { log_level=yaz_log_module_level("ztest");