* All rights reserved.
*
* $Log: zebraapi.c,v $
- * Revision 1.39 2000-11-29 14:24:01 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
* Script configure uses yaz pthreads options. Added locking for
* zebra_register_{lock,unlock}.
*
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)
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);
zebra_mutex_cond_init (&zh->session_lock);
+ if (!res_get (zh->res, "passwd"))
+ zh->passwd_db = NULL;
+ else
+ {
+ zh->passwd_db = passwd_db_open ();
+ if (!zh->passwd_db)
+ logf (LOG_WARN|LOG_ERRNO, "passwd_db_open failed");
+ else
+ passwd_db_file (zh->passwd_db, res_get (zh->res, "passwd"));
+ }
+
return zh;
}
zebraRankInstall (zh, rank1_class);
- if (!res_get (zh->res, "passwd"))
- zh->passwd_db = NULL;
- else
- {
- zh->passwd_db = passwd_db_open ();
- if (!zh->passwd_db)
- logf (LOG_WARN|LOG_ERRNO, "passwd_db_open failed");
- else
- passwd_db_file (zh->passwd_db, res_get (zh->res, "passwd"));
- }
-
if (!(zh->records = rec_open (zh->bfs, rw, 0)))
{
logf (LOG_WARN, "rec_open");
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);