odissey: fix client unroute during setup pool attach timeout
@@ -228,17 +228,9 @@ od_frontend_key(od_client_t *client)
}
static inline int
-od_frontend_setup(od_client_t *client)
+od_frontend_setup_console(shapito_stream_t *stream)
{
- od_instance_t *instance = client->system->instance;
- od_route_t *route = client->route;
- shapito_stream_t *stream = &client->stream;
- shapito_stream_reset(stream);
-
int rc;
- /* configure console client */
- if (route->scheme->storage->storage_type == OD_STORAGETYPE_LOCAL)
- {
rc = shapito_be_write_parameter_status(stream, "server_version", 15, "9.6.0", 6);
if (rc == -1)
return -1;
@@ -257,10 +249,31 @@ od_frontend_setup(od_client_t *client)
return 0;
}
+static inline int
+od_frontend_setup(od_client_t *client)
+{
+ od_instance_t *instance = client->system->instance;
+ od_route_t *route = client->route;
+ shapito_stream_t *stream = &client->stream;
+ shapito_stream_reset(stream);
+
+ int rc;
+ /* configure console client */
+ if (route->scheme->storage->storage_type == OD_STORAGETYPE_LOCAL) {
+ rc = od_frontend_setup_console(stream);
+ if (rc == -1) {
+ od_unroute(client);
+ return -1;
+ }
+ return 0;
+ }
+
od_routerstatus_t status;
status = od_router_attach(client);
- if (status != OD_ROK)
+ if (status != OD_ROK) {
+ od_unroute(client);
return -1;
+ }
od_server_t *server;
server = client->server;
