Implemented multi-threaded inbound network message processing. (#115)

Used per-session thread to offload messages from network and a single thread for processing collected messages.
This commit is contained in:
Ravin Perera
2020-09-10 15:40:08 +05:30
committed by GitHub
parent 10cfb6e75f
commit d2f45daf4c
11 changed files with 297 additions and 210 deletions

View File

@@ -73,7 +73,7 @@ namespace usr
// The received message must be the challenge response. We need to verify it.
if (session.issued_challenge.empty())
{
LOG_DBG << "No challenge found for the session " << session.uniqueid;
LOG_DBG << "No challenge found for the session " << session.uniqueid.substr(0, 10);
return -1;
}
@@ -106,18 +106,18 @@ namespace usr
add_user(session, userpubkey, user_protocol); // Add the user to the global authed user list
session.issued_challenge.clear(); // Remove the stored challenge
LOG_DBG << "User connection " << session.uniqueid << " authenticated. Public key "
LOG_DBG << "User connection " << session.uniqueid.substr(0, 10) << " authenticated. Public key "
<< userpubkeyhex;
return 0;
}
else
{
LOG_DBG << "Duplicate user public key " << session.uniqueid;
LOG_DBG << "Duplicate user public key " << session.uniqueid.substr(0, 10);
}
}
else
{
LOG_DBG << "Challenge verification failed " << session.uniqueid;
LOG_DBG << "Challenge verification failed " << session.uniqueid.substr(0, 10);
}
return -1;