MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetPeer

Method GetPeer

src/httpserver.cpp:598–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596}
597
598CService HTTPRequest::GetPeer() const
599{
600 evhttp_connection* con = evhttp_request_get_connection(req);
601 CService peer;
602 if (con) {
603 // evhttp retains ownership over returned address string
604 const char* address = "";
605 uint16_t port = 0;
606
607#ifdef HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
608 evhttp_connection_get_peer(con, &address, &port);
609#else
610 evhttp_connection_get_peer(con, (char**)&address, &port);
611#endif // HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
612
613 peer = LookupNumeric(address, port);
614 }
615 return peer;
616}
617
618std::string HTTPRequest::GetURI() const
619{

Callers 3

http_request_cbFunction · 0.80
HTTPReq_JSONRPCFunction · 0.80
FUZZ_TARGETFunction · 0.80

Calls 1

LookupNumericFunction · 0.85

Tested by 1

FUZZ_TARGETFunction · 0.64