From: Adam Dickmeiss Date: Wed, 21 Feb 2007 09:17:51 +0000 (+0000) Subject: Changed task queue management a little for ZOOM C. X-Git-Tag: YAZ.2.1.49.1~3 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=3822378d7b75625b8b879025b22bffeb5483b788;p=yaz-moved-to-github.git Changed task queue management a little for ZOOM C. When a diagnostic is produced/received (error condition), the task queue is cleared immediately. In earlier versions the task queue was cleared when a new task was inserted in the queue. The effect was that a newly inserted task was _immediately_ removed and never fired. Hence tasks were silenty forgotten. The error code is still cleared when a new task is inserted in the queue. --- diff --git a/src/zoom-c.c b/src/zoom-c.c index 7c791db..868044e 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: zoom-c.c,v 1.111 2007-02-07 17:52:44 mike Exp $ + * $Id: zoom-c.c,v 1.112 2007-02-21 09:17:51 adam Exp $ */ /** * \file zoom-c.c @@ -27,6 +27,8 @@ #include #include +#define TASK_FIX 1 + static int log_api = 0; static int log_details = 0; @@ -150,11 +152,16 @@ static void set_dset_error(ZOOM_connection c, int error, } else if (addinfo) c->addinfo = xstrdup(addinfo); - if (error) + if (error != ZOOM_ERROR_NONE) + { yaz_log(log_api, "%p set_dset_error %s %s:%d %s %s", c, c->host_port ? c->host_port : "<>", dset, error, addinfo ? addinfo : "", addinfo2 ? addinfo2 : ""); +#if TASK_FIX + ZOOM_connection_remove_tasks(c); +#endif + } } #if YAZ_HAVE_XML2 @@ -165,6 +172,8 @@ static void set_HTTP_error(ZOOM_connection c, int error, } #endif +void ZOOM_connection_remove_tasks(ZOOM_connection c); + static void set_ZOOM_error(ZOOM_connection c, int error, const char *addinfo) { @@ -1265,7 +1274,7 @@ static zoom_ret ZOOM_connection_send_init(ZOOM_connection c) odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName)); - version = odr_strdup(c->odr_out, "$Revision: 1.111 $"); + version = odr_strdup(c->odr_out, "$Revision: 1.112 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; ireq->implementationVersion =