}
else if (!rc_prep_connection)
{
- session_log(se, YLOG_LOG, "%s: postponing search: No connection",
- client_get_id(cl));
- client_set_state_nb(cl, Client_Working);
+ client_set_diagnostic(cl, 2,
+ ZOOM_diag_str(2),
+ "Cannot create connection");
+ client_set_state_nb(cl, Client_Error);
return -1;
}
co = client_get_connection(cl);
iochan_man_t iochan_man)
{
struct connection *co;
+ int ret;
co = xmalloc(sizeof(*co));
co->operation_timeout = operation_timeout;
co->session_timeout = session_timeout;
- connection_connect(co, iochan_man);
-
+ ret = connection_connect(co, iochan_man);
connection_use(1);
+ if (ret)
+ { /* error */
+ connection_destroy(co);
+ co = 0;
+ }
return co;
}