odyssey/sources/cancel.c

40 lines
826 B
C
Raw Normal View History

2017-05-29 15:33:44 +00:00
/*
2018-03-12 14:03:15 +00:00
* Odyssey.
2017-05-29 15:33:44 +00:00
*
2018-04-04 13:19:58 +00:00
* Scalable PostgreSQL connection pooler.
2017-05-29 15:33:44 +00:00
*/
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
2017-05-31 15:47:15 +00:00
#include <inttypes.h>
#include <assert.h>
2017-05-29 15:33:44 +00:00
#include <machinarium.h>
#include <kiwi.h>
#include <odyssey.h>
2017-05-29 15:33:44 +00:00
int
od_cancel(od_global_t *global,
od_rule_storage_t *storage,
kiwi_key_t *key,
od_id_t *server_id)
2017-05-29 15:33:44 +00:00
{
2018-03-13 13:17:27 +00:00
od_instance_t *instance = global->instance;
od_log(&instance->logger, "cancel", NULL, NULL,
"cancel for %s%.*s",
2017-07-26 14:35:39 +00:00
server_id->id_prefix,
2017-07-26 14:05:29 +00:00
sizeof(server_id->id), server_id->id);
od_server_t server;
od_server_init(&server);
2018-03-13 13:17:27 +00:00
server.global = global;
od_backend_connect_cancel(&server, storage, key);
od_backend_close_connection(&server);
od_backend_close(&server);
2017-05-29 15:33:44 +00:00
return 0;
}