Implement very simple HTTP streaming to handle etcd watches

This commit is contained in:
Vitaliy Filippov
2020-04-25 01:35:52 +03:00
parent 895a80dfc4
commit 35481925b1
3 changed files with 79 additions and 39 deletions
+3 -1
View File
@@ -189,6 +189,8 @@ struct osd_wanted_peer_t
int address_index;
};
struct http_response_t;
class osd_t
{
friend struct http_co_t;
@@ -295,7 +297,7 @@ class osd_t
void send_replies();
void handle_send(ring_data_t *data, int peer_fd);
void outbox_push(osd_client_t & cl, osd_op_t *op);
void http_request(std::string host, std::string request, std::function<void(int, std::string)> callback);
void http_request(std::string host, std::string request, bool streaming, std::function<void(const http_response_t *response)> callback);
void http_request_json(std::string host, std::string request, std::function<void(std::string, json11::Json data)> callback);
// peer handling (primary OSD logic)