X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fzebraapi.c;h=a2c2d550d2b963c78e9c830d8377994ebc8e1f9f;hp=577b99a1d606a0a92b06bed5ad8e0008bff25600;hb=087298c5eeb7746a1d0ded9067b1d582bd641a25;hpb=88d48fdfa040774186998d2e318ae69b11591884 diff --git a/index/zebraapi.c b/index/zebraapi.c index 577b99a..a2c2d55 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -3,7 +3,11 @@ * All rights reserved. * * $Log: zebraapi.c,v $ - * Revision 1.40 2000-11-29 15:21:31 adam + * Revision 1.41 2000-12-01 17:59:08 adam + * Fixed bug regarding online updates on WIN32. + * When zebra.cfg is not available the server will not abort. + * + * Revision 1.40 2000/11/29 15:21:31 adam * Fixed problem with passwd db. * * Revision 1.39 2000/11/29 14:24:01 adam @@ -214,8 +218,12 @@ static int zebra_register_lock (ZebraHandle zh, int rw) logf (LOG_LOG, "Register in read/write mode"); else if (zh->service->registerState == state) { + logf (LOG_LOG, "registerChange = %ld lastChange = %ld", + (long) zh->service->registerChange, (long)lastChange); if (zh->service->registerChange >= lastChange) + { return 0; + } logf (LOG_LOG, "Register completely updated since last access"); } else if (zh->service->registerState == -1) @@ -297,7 +305,7 @@ ZebraService zebra_start (const char *configName) if (!(zh->res = res_open (zh->configName))) { logf (LOG_WARN, "Failed to read resources `%s'", zh->configName); - return zh; +// return zh; } zebra_chdir (zh); zebra_server_lock_init (zh); @@ -495,7 +503,11 @@ void zebra_stop(ZebraService zs) return ; yaz_log (LOG_LOG, "zebra_stop"); - assert (!zs->sessions); + zebra_mutex_cond_lock (&zs->session_lock); + while (zs->sessions) + zebra_close (zs->sessions); + + zebra_mutex_cond_unlock (&zs->session_lock); zebra_mutex_cond_destroy (&zs->session_lock);