}
}
+void client_got_records(struct client *cl)
+{
+ if (cl->session)
+ {
+ session_alert_watch(cl->session, SESSION_WATCH_SHOW);
+ session_alert_watch(cl->session, SESSION_WATCH_RECORD);
+ }
+}
+
void client_record_response(struct client *cl)
{
struct connection *co = cl->connection;
if (ingest_record(cl, xmlrec, cl->record_offset, nmem))
yaz_log(YLOG_WARN, "Failed to ingest from %s",
client_get_url(cl));
- else
- {
- session_alert_watch(cl->session, SESSION_WATCH_SHOW);
- session_alert_watch(cl->session, SESSION_WATCH_RECORD);
- }
}
nmem_destroy(nmem);
}
void client_set_startrecs(struct client *cl, int v);
void client_remove_from_session(struct client *c);
void client_incref(struct client *c);
-
+void client_got_records(struct client *c);
#endif
/*
static void non_block_events(struct connection *co)
{
+ int got_records = 0;
IOCHAN iochan = co->iochan;
ZOOM_connection link = co->link;
while (1)
break;
case ZOOM_EVENT_RECV_RECORD:
client_record_response(cl);
+ got_records = 1;
break;
default:
yaz_log(YLOG_LOG, "Unhandled event (%d) from %s",
}
client_destroy(cl);
}
+ if (got_records)
+ {
+ struct client *cl = co->client;
+ if (cl)
+ {
+ client_incref(cl);
+ client_got_records(cl);
+ client_destroy(cl);
+ }
+ }
}
void connection_continue(struct connection *co)