X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fconnection.c;h=a8c9f207202080ce6362805f0768e50141144080;hb=9c5d5d176df284a6ec614456306e87cb3a8d2f12;hp=e3991616f5069c3713202ed034c0202ef0bea698;hpb=dfb4f442a7cafa4f85a8c1f70f9f085389f7a7b4;p=pazpar2-moved-to-github.git diff --git a/src/connection.c b/src/connection.c index e399161..a8c9f20 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1,4 +1,4 @@ -/* $Id: connection.c,v 1.10 2007-08-14 14:03:02 adam Exp $ +/* $Id: connection.c,v 1.12 2007-09-20 08:13:27 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -261,7 +261,7 @@ static void connection_handler(IOCHAN i, int event) else // we throw away response and go to idle mode { yaz_log(YLOG_DEBUG, "Ignoring result of expired operation"); - client_set_state(cl, Client_Idle); + client_set_state(cl, Client_Continue); } } /* if len==1 we do nothing but wait for more input */ @@ -335,7 +335,7 @@ int connection_send_apdu(struct connection *co, Z_APDU *a) else if (r == 1) { fprintf(stderr, "cs_put incomplete (ParaZ does not handle that)\n"); - exit(1); + return -1;; } odr_reset(global_parameters.odr_out); /* release the APDU structure */ co->state = Conn_Waiting; @@ -356,7 +356,7 @@ int connection_connect(struct connection *con) int res; struct session_database *sdb = client_get_database(con->client); - char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); + const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); assert(host->ipport); assert(con); @@ -433,7 +433,7 @@ int client_prep_connection(struct client *cl) struct session *se = client_get_session(cl); struct host *host = client_get_host(cl); struct session_database *sdb = client_get_database(cl); - char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); + const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); if (zproxy && zproxy[0] == '\0') zproxy = 0; @@ -477,8 +477,9 @@ int client_prep_connection(struct client *cl) else if (co->state == Conn_Open) { if (client_get_state(cl) == Client_Error - || client_get_state(cl) == Client_Disconnected) - client_set_state(cl, Client_Idle); + || client_get_state(cl) == Client_Disconnected + || client_get_state(cl) == Client_Idle) + client_set_state(cl, Client_Continue); iochan_setflag(co->iochan, EVENT_OUTPUT); } return 1;