- int len = cs_get(co->link, &co->ibuf, &co->ibufsize);
-
- if (len < 0)
- {
- yaz_log(YLOG_WARN|YLOG_ERRNO, "Error reading from %s",
- client_get_url(cl));
- connection_destroy(co);
- return;
- }
- else if (len == 0)
- {
- yaz_log(YLOG_WARN, "EOF reading from %s", client_get_url(cl));
- connection_destroy(co);
- return;
- }
- else if (len > 1) // We discard input if we have no connection
- {
- co->state = Conn_Open;
-
- if (client_is_our_response(cl))
- {
- Z_APDU *a;
- struct session_database *sdb = client_get_database(cl);
- const char *apdulog = session_setting_oneval(sdb, PZ_APDULOG);
-
- odr_reset(global_parameters.odr_in);
- odr_setbuf(global_parameters.odr_in, co->ibuf, len, 0);
- if (!z_APDU(global_parameters.odr_in, &a, 0, 0))
- {
- client_fatal(cl);
- return;
- }