Rework HTTP client to use keepalive, move getifaddr_list to addr_util

This commit is contained in:
Vitaliy Filippov
2022-01-03 14:52:01 +03:00
parent c3304bce27
commit 5473d5b4a2
8 changed files with 459 additions and 342 deletions
+3 -2
View File
@@ -71,7 +71,7 @@ struct inode_watch_t
inode_config_t cfg;
};
struct websocket_t;
struct http_co_t;
struct etcd_state_client_t
{
@@ -82,10 +82,11 @@ protected:
std::string selected_etcd_address;
std::vector<std::string> addresses_to_try;
std::vector<inode_watch_t*> watches;
websocket_t *etcd_watch_ws = NULL;
http_co_t *etcd_watch_ws = NULL, *keepalive_client = NULL;
int ws_keepalive_timer = -1;
int ws_alive = 0;
uint64_t bs_block_size = DEFAULT_BLOCK_SIZE;
int etcd_keepalive_interval = 10;
void add_etcd_url(std::string);
void pick_next_etcd();
public: