From ce3da20314686e63c6c0e2d1cbb265d09d43e248 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 3 Nov 2011 13:40:07 +0100 Subject: [PATCH] Add client_set_state_nb Is like client_set_state, but never calls session_alert_watch. This is used in the search phase, when a show is never fired anyway and also because session is locked already so session_alert_watch would make a deal-lock. --- src/client.c | 5 +++++ src/client.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/client.c b/src/client.c index e17e604..0a1eb61 100644 --- a/src/client.c +++ b/src/client.c @@ -162,6 +162,11 @@ enum client_state client_get_state(struct client *cl) return cl->state; } +void client_set_state_nb(struct client *cl, enum client_state st) +{ + cl->state = st; +} + void client_set_state(struct client *cl, enum client_state st) { int was_active = 0; diff --git a/src/client.h b/src/client.h index 2fb8ada..9cc9666 100644 --- a/src/client.h +++ b/src/client.h @@ -52,6 +52,7 @@ void client_show_raw_remove(struct client *cl, void *rr); const char *client_get_state_str(struct client *cl); enum client_state client_get_state(struct client *cl); void client_set_state(struct client *cl, enum client_state st); +void client_set_state_nb(struct client *cl, enum client_state st); struct connection *client_get_connection(struct client *cl); struct session_database *client_get_database(struct client *cl); void client_set_database(struct client *cl, struct session_database *db); -- 1.7.10.4