client_prep_connection returns 2 if connection was re-usable
and only in that case will the result set be re-used - for same
search.
{
assert(co->host);
if (co->host == host && client_get_state(cl) == Client_Idle)
{
assert(co->host);
if (co->host == host && client_get_state(cl) == Client_Idle)
- ; /* reusing connection. It's ours! */
- else
- client_incref(cl);
- connection_release(co);
- co = 0;
+ client_incref(cl);
+ connection_release(co);
+ co = 0;
no_failed_query++;
else if (parse_ret == -2)
no_failed_limit++;
no_failed_query++;
else if (parse_ret == -2)
no_failed_limit++;
- else if (parse_ret == 0)
- {
- session_log(se, YLOG_LOG, "client NEW %s", client_get_id(cl));
- no_working++;
- if (client_prep_connection(cl, se->service->z3950_operation_timeout,
- se->service->z3950_session_timeout,
- se->service->server->iochan_man,
- &tval))
- client_start_search(cl);
- }
- session_log(se, YLOG_LOG, "client REUSE %s", client_get_id(cl));
- no_working++;
- if (client_prep_connection(cl, se->service->z3950_operation_timeout,
+ int r =
+ client_prep_connection(cl, se->service->z3950_operation_timeout,
se->service->z3950_session_timeout,
se->service->server->iochan_man,
se->service->z3950_session_timeout,
se->service->server->iochan_man,
+ &tval);
+ if (parse_ret == 1 && r == 2)
+ session_log(se, YLOG_LOG, "client REUSE %s", client_get_id(cl));
+ else
+ {
+ session_log(se, YLOG_LOG, "client NEW %s", client_get_id(cl));
+ client_start_search(cl);
+ }
+ no_working++;
}
}
facet_limits_destroy(facet_limits);
}
}
facet_limits_destroy(facet_limits);