From 9e67dda5a91d3dfec77542ea5e503452fd27326c Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 9 May 2013 21:53:54 -0700 Subject: [PATCH] make use of base-64 encoding runtime-configurable --- xwords4/relay/dbmgr.cpp | 5 +++-- xwords4/relay/xwrelay.conf_tmplate | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xwords4/relay/dbmgr.cpp b/xwords4/relay/dbmgr.cpp index 75246fef1..71014f8e3 100644 --- a/xwords4/relay/dbmgr.cpp +++ b/xwords4/relay/dbmgr.cpp @@ -62,8 +62,9 @@ DBMgr::Get() DBMgr::DBMgr() { - logf( XW_LOGINFO, "%s called", __func__ ); - m_useB64 = false; + int tmp; + RelayConfigs::GetConfigs()->GetValueFor( "USE_B64", &tmp ); + m_useB64 = tmp != 0; pthread_key_create( &m_conn_key, destr_function ); diff --git a/xwords4/relay/xwrelay.conf_tmplate b/xwords4/relay/xwrelay.conf_tmplate index 27d79ec06..66d455a6b 100644 --- a/xwords4/relay/xwrelay.conf_tmplate +++ b/xwords4/relay/xwrelay.conf_tmplate @@ -63,3 +63,8 @@ LOGFILE_PATH=./xwrelay.log # Delay sending packets so devices/emulators on the same machine as # relay have a bit more natural experience # SEND_DELAY_MILLIS=500 + +# Use base64 encoding rather than PQescapeByteaConn for stored +# messages. The latter doesn't seem as reliable with newer psql +# servers. Anything but 0 is treated as true. +USE_B64=1