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)
{
client_set_connection(cl, new);
new->link = 0;
new->resultset = 0;
- new->state = Conn_Connecting;
+ new->state = Conn_Resolving;
if (host->ipport)
connection_connect(new);
return new;
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));
}
}
}
else
{
connection_connect(con);
+ client_start_search(con->client);
}
}
else
struct session_database *sdb = client_get_database(con->client);
const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY);
+ const char *apdulog = session_setting_oneval(sdb, PZ_APDULOG);
assert(host->ipport);
assert(con);
global_parameters.implementationName);
ZOOM_options_set(zoptions, "implementationVersion",
global_parameters.implementationVersion);
-
if (zproxy && *zproxy)
{
con->zproxy = xstrdup(zproxy);
ZOOM_options_set(zoptions, "proxy", zproxy);
}
+ if (apdulog && *apdulog)
+ ZOOM_options_set(zoptions, "apdulog", apdulog);
if ((auth = (char*) session_setting_oneval(sdb, PZ_AUTHENTICATION)))
ZOOM_options_set(zoptions, "user", auth);
co = connection_create(cl);
}
- if (co)
+ if (co && co->link)
return 1;
else
return 0;