Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show All 20 Lines | |||||
#include <event2/keyvalq_struct.h> | #include <event2/keyvalq_struct.h> | ||||
#include <compat/stdin.h> | #include <compat/stdin.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <cstdio> | #include <cstdio> | ||||
#include <functional> | #include <functional> | ||||
#include <memory> | #include <memory> | ||||
#include <string> | |||||
#include <tuple> | #include <tuple> | ||||
const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | ||||
static const char DEFAULT_RPCCONNECT[] = "127.0.0.1"; | static const char DEFAULT_RPCCONNECT[] = "127.0.0.1"; | ||||
static const int DEFAULT_HTTP_CLIENT_TIMEOUT = 900; | static const int DEFAULT_HTTP_CLIENT_TIMEOUT = 900; | ||||
static const bool DEFAULT_NAMED = false; | static const bool DEFAULT_NAMED = false; | ||||
static const int CONTINUE_EXECUTION = -1; | static const int CONTINUE_EXECUTION = -1; | ||||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | |||||
struct HTTPReply { | struct HTTPReply { | ||||
HTTPReply() : status(0), error(-1) {} | HTTPReply() : status(0), error(-1) {} | ||||
int status; | int status; | ||||
int error; | int error; | ||||
std::string body; | std::string body; | ||||
}; | }; | ||||
static const char *http_errorstring(int code) { | static std::string http_errorstring(int code) { | ||||
switch (code) { | switch (code) { | ||||
#if LIBEVENT_VERSION_NUMBER >= 0x02010300 | #if LIBEVENT_VERSION_NUMBER >= 0x02010300 | ||||
case EVREQ_HTTP_TIMEOUT: | case EVREQ_HTTP_TIMEOUT: | ||||
return "timeout reached"; | return "timeout reached"; | ||||
case EVREQ_HTTP_EOF: | case EVREQ_HTTP_EOF: | ||||
return "EOF reached"; | return "EOF reached"; | ||||
case EVREQ_HTTP_INVALID_HEADER: | case EVREQ_HTTP_INVALID_HEADER: | ||||
return "error while reading header, or invalid header"; | return "error while reading header, or invalid header"; | ||||
▲ Show 20 Lines • Show All 476 Lines • Show Last 20 Lines |