From 6755b9a05f1a95ce8fa468bcfb9458e158e9f5a8 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 8 Sep 2009 09:23:53 +0200 Subject: [PATCH] Remove more semi-unused globals --- src/client.c | 13 ++++++++----- src/connection.c | 6 ++---- src/logic.c | 5 ----- src/parameters.h | 5 ----- src/pazpar2.c | 3 --- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/client.c b/src/client.c index 6a29bac..d17e640 100644 --- a/src/client.c +++ b/src/client.c @@ -644,17 +644,20 @@ static char *make_cqlquery(struct client *cl) char *r; WRBUF wrb = wrbuf_alloc(); int status; + ODR odr_out = odr_createmem(ODR_ENCODE); - zquery = p_query_rpn(global_parameters.odr_out, cl->pquery); + zquery = p_query_rpn(odr_out, cl->pquery); if ((status = cql_transform_rpn2cql_wrbuf(cqlt, wrb, zquery))) { yaz_log(YLOG_WARN, "failed to generate CQL query, code=%d", status); - return 0; + r = 0; } - r = xstrdup(wrbuf_cstr(wrb)); - + else + { + r = xstrdup(wrbuf_cstr(wrb)); + } wrbuf_destroy(wrb); - odr_reset(global_parameters.odr_out); // releases the zquery + odr_destroy(odr_out); cql_transform_close(cqlt); return r; } diff --git a/src/connection.c b/src/connection.c index 18be84b..8d8d48f 100644 --- a/src/connection.c +++ b/src/connection.c @@ -351,10 +351,8 @@ static int connection_connect(struct connection *con) assert(con); ZOOM_options_set(zoptions, "async", "1"); - ZOOM_options_set(zoptions, "implementationName", - global_parameters.implementationName); - ZOOM_options_set(zoptions, "implementationVersion", - global_parameters.implementationVersion); + ZOOM_options_set(zoptions, "implementationName", PACKAGE_NAME); + ZOOM_options_set(zoptions, "implementationVersion", VERSION); if (zproxy && *zproxy) { con->zproxy = xstrdup(zproxy); diff --git a/src/logic.c b/src/logic.c index 7241594..f60ca18 100644 --- a/src/logic.c +++ b/src/logic.c @@ -79,14 +79,9 @@ struct parameters global_parameters = 0, // dump_records 0, // debug_mode 30, // operations timeout - "81", - "Index Data PazPar2", - VERSION, 60, // session timeout 100, MAX_CHUNK, - 0, - 0, 180, // Z39.50 session timeout 15 // Connect timeout }; diff --git a/src/parameters.h b/src/parameters.h index 3905c92..108c92d 100644 --- a/src/parameters.h +++ b/src/parameters.h @@ -27,14 +27,9 @@ struct parameters { int dump_records; int debug_mode; int timeout; /* operations timeout, in seconds */ - char implementationId[128]; - char implementationName[128]; - char implementationVersion[128]; int session_timeout; int toget; int chunk; - ODR odr_out; - ODR odr_in; int z3950_session_timeout; int z3950_connect_timeout; }; diff --git a/src/pazpar2.c b/src/pazpar2.c index f982a03..caafc4f 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -41,9 +41,6 @@ void child_handler(void *data) struct conf_config *config = (struct conf_config *) data; config_read_settings(config, path_override); - global_parameters.odr_in = odr_createmem(ODR_DECODE); - global_parameters.odr_out = odr_createmem(ODR_ENCODE); - pazpar2_event_loop(); } -- 1.7.10.4