- verboser log, faster start
[oweals/gnunet.git] / src / lockmanager / gnunet-service-lockmanager.c
index 91e103aa0a96ae32de3bbc706f46907c9315b5ab..e509fc68fd943b1e2093af07bf692c24bf2ab340 100644 (file)
@@ -595,7 +595,7 @@ handle_acquire (void *cls, struct GNUNET_SERVER_Client *client,
   {
     if (lock->cl_entry == cl_entry)
     {                           /* Client is requesting a lock it already owns */
-      GNUNET_break (0);
+      GNUNET_break_op (0);
       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
       return;
     }
@@ -730,6 +730,7 @@ client_disconnect_cb (void *cls, struct GNUNET_SERVER_Client *client)
   struct ClientList *cl_entry;
   struct LockList *ll_entry;
   struct Lock *lock;
+  struct WaitList *wl_entry;
 
   if (NULL == client)
     return;
@@ -742,7 +743,14 @@ client_disconnect_cb (void *cls, struct GNUNET_SERVER_Client *client)
   {
     lock = ll_entry->lock;
     cl_ll_remove_lock (cl_entry, ll_entry);
-    process_lock_release (lock);
+    if (lock->cl_entry == cl_entry)
+      process_lock_release (lock);
+    else
+    {
+      wl_entry = lock_wl_find (lock, cl_entry);
+      GNUNET_assert (NULL != wl_entry);
+      lock_wl_remove (lock, wl_entry);
+    }
   }
   cl_remove_client (cl_entry);
 }