From 465cbcd4192d063f8688204eb59adb57b3e75a6c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 17 Jan 2012 12:29:00 +0100 Subject: [PATCH] Simplify client_prep_connection --- src/client.h | 3 +-- src/connection.c | 6 ++---- src/session.c | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/client.h b/src/client.h index 7a840b1..7971408 100644 --- a/src/client.h +++ b/src/client.h @@ -77,8 +77,7 @@ void client_disconnect(struct client *cl); int client_prep_connection(struct client *cl, int operation_timeout, int session_timeout, iochan_man_t iochan, - const struct timeval *abstime, - int ok_with_working); + const struct timeval *abstime); void client_start_search(struct client *cl); void client_set_session(struct client *cl, struct session *se); int client_is_active(struct client *cl); diff --git a/src/connection.c b/src/connection.c index 02509cf..e441514 100644 --- a/src/connection.c +++ b/src/connection.c @@ -496,8 +496,7 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man) int client_prep_connection(struct client *cl, int operation_timeout, int session_timeout, iochan_man_t iochan_man, - const struct timeval *abstime, - int ok_with_working) + const struct timeval *abstime) { struct connection *co; struct session_database *sdb = client_get_database(cl); @@ -526,8 +525,7 @@ int client_prep_connection(struct client *cl, if (co) { assert(co->host); - if (co->host == host && (client_get_state(cl) == Client_Idle - || ok_with_working)) + if (co->host == host && client_get_state(cl) == Client_Idle) { return 2; } diff --git a/src/session.c b/src/session.c index 3e00cc1..fcf29fa 100644 --- a/src/session.c +++ b/src/session.c @@ -741,7 +741,7 @@ enum pazpar2_error_code session_search(struct session *se, client_prep_connection(cl, se->service->z3950_operation_timeout, se->service->z3950_session_timeout, se->service->server->iochan_man, - &tval, 0); + &tval); if (parse_ret == 1 && r == 2) { session_log(se, YLOG_LOG, "client REUSE %s", client_get_id(cl)); -- 1.7.10.4