MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / GetPeer

Method GetPeer

src/rpc/core/httpserver.cpp:607–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607CService HTTPRequest::GetPeer() const {
608 evhttp_connection* con = evhttp_request_get_connection(req);
609 CService peer;
610 if (con) {
611 // evhttp retains ownership over returned address string
612 const char* address = "";
613 uint16_t port = 0;
614 evhttp_connection_get_peer(con, (char**)&address, &port);
615 LookupNumeric(address, peer, port);
616 }
617 return peer;
618}
619
620std::string HTTPRequest::GetURI() const { return evhttp_request_get_uri(req); }
621

Callers 2

http_request_cbFunction · 0.80
JsonRPCHandlerFunction · 0.80

Calls 1

LookupNumericFunction · 0.85

Tested by

no test coverage detected