Correctly handle connections that fail security checks (RIPD-1114):

* Return error code 400 to the peer along with a descriptive message
* Release the slot and decrement IP connection counters.
This commit is contained in:
Nik Bougalis
2016-04-21 15:03:04 -07:00
parent 5e5d5fdee4
commit b5dbd7942f
5 changed files with 65 additions and 13 deletions

View File

@@ -276,6 +276,11 @@ private:
makeRedirectResponse (PeerFinder::Slot::ptr const& slot,
http_request_type const& request, address_type remote_address);
std::shared_ptr<Writer>
makeErrorResponse (PeerFinder::Slot::ptr const& slot,
http_request_type const& request, address_type remote_address,
std::string msg);
bool
processRequest (http_request_type const& req,
Handoff& handoff);