| 730 | } |
| 731 | |
| 732 | CService HTTPRequest::GetPeer() const { |
| 733 | evhttp_connection *con = evhttp_request_get_connection(req); |
| 734 | CService peer; |
| 735 | if (con) { |
| 736 | // evhttp retains ownership over returned address string |
| 737 | const char *address = ""; |
| 738 | uint16_t port = 0; |
| 739 | evhttp_connection_get_peer(con, (char **)&address, &port); |
| 740 | peer = LookupNumeric(address, port); |
| 741 | } |
| 742 | return peer; |
| 743 | } |
| 744 | |
| 745 | std::string HTTPRequest::GetURI() const { |
| 746 | return evhttp_request_get_uri(req); |