static void client_show_raw_error(struct client *cl, const char *addinfo);
-// Close connection and set state to error
-void client_fatal(struct client *cl)
-{
- yaz_log(YLOG_WARN, "Fatal error from %s", client_get_url(cl));
- connection_destroy(cl->connection);
- client_set_state(cl, Client_Error);
-}
-
struct connection *client_get_connection(struct client *cl)
{
return cl->connection;
const char *client_get_state_str(struct client *cl);
enum client_state client_get_state(struct client *cl);
void client_set_state(struct client *cl, enum client_state st);
-void client_fatal(struct client *cl);
struct connection *client_get_connection(struct client *cl);
struct session_database *client_get_database(struct client *cl);
void client_set_database(struct client *cl, struct session_database *db);
}
// Close connection and recycle structure
-void connection_destroy(struct connection *co)
+static void connection_destroy(struct connection *co)
{
if (co->link)
{
if (co->state == Conn_Connecting)
{
yaz_log(YLOG_WARN, "connect timeout %s", client_get_url(cl));
- client_fatal(cl);
+
+ connection_destroy(co);
+ client_set_state(cl, Client_Error);
}
else if (client_get_state(co->client) == Client_Idle)
{
struct host;
struct session;
-void connection_destroy(struct connection *co);
void connect_resolver_host(struct host *host, iochan_man_t iochan);
const char *connection_get_url(struct connection *co);
void connection_release(struct connection *co);