From: Sebastian Hammer Date: Fri, 23 Oct 2009 18:40:03 +0000 (+0000) Subject: Diagnostic member was not set on connection error. Fixed X-Git-Tag: v1.2.3~8 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=70b88d6e85b42debc319af76d89979a0f058e429;p=pazpar2-moved-to-github.git Diagnostic member was not set on connection error. Fixed --- diff --git a/src/client.c b/src/client.c index 22d1073..e70a08e 100644 --- a/src/client.c +++ b/src/client.c @@ -795,6 +795,11 @@ int client_get_num_records(struct client *cl) return cl->record_offset; } +void client_set_diagnostic(struct client *cl, int diagnostic) +{ + cl->diagnostic = diagnostic; +} + int client_get_diagnostic(struct client *cl) { return cl->diagnostic; diff --git a/src/client.h b/src/client.h index 93b2e32..35a28d9 100644 --- a/src/client.h +++ b/src/client.h @@ -82,6 +82,7 @@ int client_parse_query(struct client *cl, const char *query); int client_get_hits(struct client *cl); int client_get_num_records(struct client *cl); int client_get_diagnostic(struct client *cl); +void client_set_diagnostic(struct client *cl, int diagnostic); void client_set_database(struct client *cl, struct session_database *db); struct host *client_get_host(struct client *cl); const char *client_get_url(struct client *cl); diff --git a/src/connection.c b/src/connection.c index 7496a1c..8df4ac7 100644 --- a/src/connection.c +++ b/src/connection.c @@ -183,12 +183,14 @@ static void non_block_events(struct connection *co) case ZOOM_EVENT_END: { const char *error, *addinfo; - if (ZOOM_connection_error(link, &error, &addinfo)) + int err; + if ((err = ZOOM_connection_error(link, &error, &addinfo))) { yaz_log(YLOG_LOG, "Error %s from %s", error, client_get_url(cl)); } iochan_settimeout(iochan, co->session_timeout); + client_set_diagnostic(cl, err); client_set_state(cl, Client_Idle); } break;