MCPcopy Create free account
hub / github.com/Raptor3um/raptoreum / GetPeer

Method GetPeer

src/httpserver.cpp:599–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599CService HTTPRequest::GetPeer() {
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 peer = LookupNumeric(address, port);
613 }
614 return peer;
615}
616
617std::string HTTPRequest::GetURI() {
618 return evhttp_request_get_uri(req);

Callers 2

http_request_cbFunction · 0.80
HTTPReq_JSONRPCFunction · 0.80

Calls 1

LookupNumericFunction · 0.85

Tested by

no test coverage detected