Ensure show watch is fired if client is disconnected.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 2 Oct 2007 10:32:03 +0000 (10:32 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 2 Oct 2007 10:32:03 +0000 (10:32 +0000)
When a client is disconnected connection_destroy and, in turn,
client_disconnect is invoked. This function now calls client_set_state
rather than setting the state directly.

src/client.c

index 4f87d1f..dffb359 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.26 2007-10-02 10:11:56 adam Exp $
+/* $Id: client.c,v 1.27 2007-10-02 10:32:03 adam Exp $
    Copyright (c) 2006-2007, Index Data.
 
 This file is part of Pazpar2.
@@ -899,7 +899,7 @@ void client_set_connection(struct client *cl, struct connection *con)
 void client_disconnect(struct client *cl)
 {
     if (cl->state != Client_Idle)
-        cl->state = Client_Disconnected;
+        client_set_state(cl, Client_Disconnected);
     client_set_connection(cl, 0);
 }