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
+4 -2
View File
@@ -6,12 +6,14 @@
struct http_response_t
{
int status_code;
bool eof = false;
int error_code = 0;
int status_code = 0;
std::string status_line;
std::map<std::string, std::string> headers;
std::string body;
};
http_response_t *parse_http_response(std::string res);
void parse_headers(std::string & res, http_response_t *parsed);
std::vector<std::string> getifaddr_list(bool include_v6 = false);
uint64_t stoull_full(const std::string & str, int base = 10);