From 7cb62ced95e780a2069cec1046fa6713740e43c4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 29 Mar 2010 15:01:33 +0200 Subject: [PATCH] Ensure that connection is only used by one client While the host and thereby the connection is locked, we mark the newly assigned client Client_Working. This is to prevent that one connection gets used by two clients. --- src/connection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/connection.c b/src/connection.c index fecf51b..72c1260 100644 --- a/src/connection.c +++ b/src/connection.c @@ -475,6 +475,9 @@ int client_prep_connection(struct client *cl, connection_release(co); client_set_connection(cl, co); co->client = cl; + /* ensure that connection is only assigned to this client + by marking the client non Idle */ + client_set_state(cl, Client_Working); yaz_mutex_leave(host->mutex); co->operation_timeout = operation_timeout; co->session_timeout = session_timeout; -- 1.7.10.4