Address review: restore two log lines, drop a useless mutex

- pqissllistener: restore the unconditional "connected to" stderr line
  on successful incoming connections, as requested.
- rsgxsnetservice: log the missing-recipients case unconditionally again
  (as a one-line RsWarn with the circle id) instead of hiding it behind
  NXS_NET_DEBUG_7 — it can be a genuine error signal.
- distributedchat: remove the mutex from logBannedIdentityDrop(): both
  callers are in the chat item receiving path, which is single-threaded.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jolavillette 2026-08-01 20:51:11 +02:00
parent 28403e0e38
commit f81ea870bf
3 changed files with 6 additions and 7 deletions

View File

@ -68,14 +68,14 @@ static const uint32_t MAX_MESSAGES_PER_SECONDS_PERIOD = 10 ; // duration
// identity starts, then one summary line per identity per REPORT_INTERVAL carrying the number of
// items dropped in between. No error is hidden: signature mismatches and other genuine problems are
// logged separately and unconditionally.
//
// No mutex: both callers sit in the chat item receiving path (p3ChatService::receiveChatQueue ->
// handleRecvItem), which runs in a single thread.
static void logBannedIdentityDrop(const RsGxsId& keyId)
{
static const rstime_t REPORT_INTERVAL = 60; // seconds
static RsMutex banned_drop_log_mtx("bannedDropLog");
static std::map<RsGxsId,std::pair<uint32_t,rstime_t> > stats; // id -> (drops since last report, last report time)
RS_STACK_MUTEX(banned_drop_log_mtx);
rstime_t now = time(nullptr);
auto it = stats.find(keyId);

View File

@ -3749,10 +3749,7 @@ bool RsGxsNetService::encryptSingleNxsItem(RsNxsItem *item, const RsGxsCircleId&
if(!mCircles->recipients(destination_circle,destination_group,recipients))
{
// Not an error: the circle membership may simply not be cached yet. The caller retries later.
#ifdef NXS_NET_DEBUG_7
GXSNETDEBUG_P_(item->PeerId()) << " Cannot encrypt transaction yet: recipients list not available for circle " << destination_circle << ". Will re-try later." << std::endl;
#endif
RsWarn() << "Cannot encrypt transaction: recipients list not available for circle " << destination_circle << ". Will re-try later." ;
status = RS_NXS_ITEM_ENCRYPTION_STATUS_CIRCLE_ERROR ;
return false ;
}

View File

@ -878,6 +878,8 @@ int pqissllistener::finaliseConnection(int fd, SSL *ssl, const RsPeerId& peerId,
"pqissllistener::finaliseConnection() matched peer " + peerId.toStdString()
+ " from " + sockaddr_storage_tostring(remote_addr) + " => handing to pqissl");
std::cerr << "pqissllistenner::finaliseConnection() connected to " << sockaddr_storage_tostring(remote_addr) << std::endl;
// hand off ssl conection.
pqissl *pqis = it -> second;
pqis -> accept(ssl, fd, remote_addr);