odissey: fix error message prefix; put client to pending pool on tmout

This commit is contained in:
Dmitry Simonenko 2017-06-09 16:21:40 +03:00
parent 5b3935e95f
commit b8ae45f9b0
2 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,7 @@ int od_frontend_error(od_client_t *client, char *code, char *fmt, ...)
char msg[512]; char msg[512];
int msg_len; int msg_len;
msg_len = snprintf(msg, sizeof(msg), "odissey: "); msg_len = snprintf(msg, sizeof(msg), "odissey: ");
msg_len += vsnprintf(msg, sizeof(msg), fmt, args); msg_len += vsnprintf(msg + msg_len, sizeof(msg) - msg_len, fmt, args);
va_end(args); va_end(args);
so_stream_t *stream = &client->stream; so_stream_t *stream = &client->stream;
so_stream_reset(stream); so_stream_reset(stream);

View File

@ -155,6 +155,7 @@ od_router_attacher(void *arg)
int rc; int rc;
rc = machine_condition(route->scheme->pool_timeout); rc = machine_condition(route->scheme->pool_timeout);
if (rc < 0) { if (rc < 0) {
od_clientpool_set(&route->client_pool, client, OD_CPENDING);
od_debug_client(&instance->log, client->id, "router", od_debug_client(&instance->log, client->id, "router",
"server pool wait timedout, closing"); "server pool wait timedout, closing");
msg_attach->status = OD_RERROR_TIMEDOUT; msg_attach->status = OD_RERROR_TIMEDOUT;