From 950e754ca2e55417a698c6b90eb5223f9179ad11 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 17 Jun 2013 07:26:10 -0700 Subject: [PATCH] cleanup --- xwords4/relay/crefmgr.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xwords4/relay/crefmgr.h b/xwords4/relay/crefmgr.h index 7f657c2ab..242f7fbf3 100644 --- a/xwords4/relay/crefmgr.h +++ b/xwords4/relay/crefmgr.h @@ -187,14 +187,15 @@ class SafeCref { bool Forward( HostID src, const AddrInfo* addr, HostID dest, const unsigned char* buf, int buflen ) { - if ( IsValid() ) { + bool success = IsValid(); + if ( success ) { CookieRef* cref = m_cinfo->GetRef(); assert( 0 != cref->GetCid() ); cref->_Forward( src, addr, dest, buf, buflen ); - return true; } else { - return false; + logf( XW_LOGINFO, "%s: unable to forward", __func__ ); } + return success; } void PutMsg( HostID srcID, const AddrInfo* addr, HostID destID, @@ -252,14 +253,14 @@ class SafeCref { } bool HandleAck(HostID hostID ) { - if ( IsValid() ) { + bool handled = IsValid(); + if ( handled ) { CookieRef* cref = m_cinfo->GetRef(); assert( 0 != cref->GetCid() ); cref->_HandleAck( hostID ); - return true; - } else { - return false; } + logf( XW_LOGINFO, "%s => %d", __func__, handled ); + return handled; } void Shutdown() { if ( IsValid() ) {