X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fconnection.c;h=155619f3c06a803340ca355fd71565fcc90e377d;hb=043c2f97c9b6fa76fbe50c27c4d145a0f16e9e82;hp=11de6b2c5c214210145cf8e4623be2cad072e801;hpb=e0137771468a257cd1de73219d656f074b1c63ea;p=pazpar2-moved-to-github.git diff --git a/src/connection.c b/src/connection.c index 11de6b2..155619f 100644 --- a/src/connection.c +++ b/src/connection.c @@ -133,6 +133,14 @@ static void remove_connection_from_host(struct connection *con) assert(*conp == 0); } +void connection_continue(struct connection *co) +{ +#if 1 + yaz_log(YLOG_LOG, "connection_continue"); + iochan_setevent(co->iochan, EVENT_OUTPUT); +#endif +} + // Close connection and recycle structure void connection_destroy(struct connection *co) { @@ -221,44 +229,45 @@ static void connection_handler(IOCHAN i, int event) if (ZOOM_event(1, &link)) { - do { + do + { int event = ZOOM_connection_last_event(link); switch (event) { - case ZOOM_EVENT_END: - break; - case ZOOM_EVENT_SEND_DATA: - break; - case ZOOM_EVENT_RECV_DATA: - break; - case ZOOM_EVENT_UNKNOWN: - break; - case ZOOM_EVENT_SEND_APDU: - client_set_state(co->client, Client_Working); - break; - case ZOOM_EVENT_RECV_APDU: - client_set_state(co->client, Client_Idle); - break; - case ZOOM_EVENT_CONNECT: - yaz_log(YLOG_LOG, "Connected to %s", client_get_url(cl)); - co->state = Conn_Open; - client_set_state(co->client, Client_Connected); - iochan_settimeout(i, global_parameters.z3950_session_timeout); - break; - case ZOOM_EVENT_RECV_SEARCH: - yaz_log(YLOG_LOG, "Search response from %s", client_get_url(cl)); - client_search_response(cl); - break; - case ZOOM_EVENT_RECV_RECORD: - yaz_log(YLOG_LOG, "Record from %s", client_get_url(cl)); - client_record_response(cl); - break; - default: - yaz_log(YLOG_LOG, "Unhandled event (%d) from %s", + case ZOOM_EVENT_END: + break; + case ZOOM_EVENT_SEND_DATA: + break; + case ZOOM_EVENT_RECV_DATA: + break; + case ZOOM_EVENT_UNKNOWN: + break; + case ZOOM_EVENT_SEND_APDU: + client_set_state(co->client, Client_Working); + break; + case ZOOM_EVENT_RECV_APDU: + client_set_state(co->client, Client_Idle); + break; + case ZOOM_EVENT_CONNECT: + yaz_log(YLOG_LOG, "Connected to %s", client_get_url(cl)); + co->state = Conn_Open; + client_set_state(co->client, Client_Connected); + iochan_settimeout(i, global_parameters.z3950_session_timeout); + break; + case ZOOM_EVENT_RECV_SEARCH: + yaz_log(YLOG_LOG, "Search response from %s", client_get_url(cl)); + client_search_response(cl); + break; + case ZOOM_EVENT_RECV_RECORD: + yaz_log(YLOG_LOG, "Record from %s", client_get_url(cl)); + client_record_response(cl); + break; + default: + yaz_log(YLOG_LOG, "Unhandled event (%d) from %s", event, client_get_url(cl)); } } - while(ZOOM_event_nonblock(1, &link)); + while (ZOOM_event_nonblock(1, &link)); } } }