mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
Merge remote-tracking branch 'origin/android_branch' into android_branch
This commit is contained in:
commit
7ecaf76b22
4 changed files with 30 additions and 20 deletions
|
@ -45,6 +45,7 @@ OBJ = $(patsubst %.cpp,%.o,$(SRC))
|
||||||
LDFLAGS += -pthread -g $(STATIC)
|
LDFLAGS += -pthread -g $(STATIC)
|
||||||
LDFLAGS += -L$(shell pg_config --libdir)
|
LDFLAGS += -L$(shell pg_config --libdir)
|
||||||
LDFLAGS += $(shell pkg-config --libs glib-2.0)
|
LDFLAGS += $(shell pkg-config --libs glib-2.0)
|
||||||
|
LDFLAGS += -lrt
|
||||||
|
|
||||||
CPPFLAGS += -DSPAWN_SELF -g -Wall
|
CPPFLAGS += -DSPAWN_SELF -g -Wall
|
||||||
CPPFLAGS += -I $(shell pg_config --includedir)
|
CPPFLAGS += -I $(shell pg_config --includedir)
|
||||||
|
|
|
@ -857,12 +857,11 @@ void
|
||||||
CookieRef::send_stored_messages( HostID dest, const AddrInfo* addr )
|
CookieRef::send_stored_messages( HostID dest, const AddrInfo* addr )
|
||||||
{
|
{
|
||||||
logf( XW_LOGVERBOSE0, "%s(dest=%d)", __func__, dest );
|
logf( XW_LOGVERBOSE0, "%s(dest=%d)", __func__, dest );
|
||||||
|
|
||||||
assert( dest > 0 && dest <= 4 );
|
assert( dest > 0 && dest <= 4 );
|
||||||
if ( addr->isCurrent() ) {
|
|
||||||
DBMgr* dbmgr = DBMgr::Get();
|
DBMgr* dbmgr = DBMgr::Get();
|
||||||
const char* cname = ConnName();
|
const char* cname = ConnName();
|
||||||
for ( ; ; ) {
|
while ( addr->isCurrent() ) {
|
||||||
unsigned char buf[MAX_MSG_LEN];
|
unsigned char buf[MAX_MSG_LEN];
|
||||||
size_t buflen = sizeof(buf);
|
size_t buflen = sizeof(buf);
|
||||||
int msgID;
|
int msgID;
|
||||||
|
@ -872,7 +871,6 @@ CookieRef::send_stored_messages( HostID dest, const AddrInfo* addr )
|
||||||
}
|
}
|
||||||
dbmgr->RemoveStoredMessages( &msgID, 1 );
|
dbmgr->RemoveStoredMessages( &msgID, 1 );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} /* send_stored_messages */
|
} /* send_stored_messages */
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -65,6 +65,7 @@ DBMgr::DBMgr()
|
||||||
int tmp;
|
int tmp;
|
||||||
RelayConfigs::GetConfigs()->GetValueFor( "USE_B64", &tmp );
|
RelayConfigs::GetConfigs()->GetValueFor( "USE_B64", &tmp );
|
||||||
m_useB64 = tmp != 0;
|
m_useB64 = tmp != 0;
|
||||||
|
logf( XW_LOGINFO, "%s: m_useB64=%d", __func__, m_useB64 );
|
||||||
|
|
||||||
pthread_key_create( &m_conn_key, destr_function );
|
pthread_key_create( &m_conn_key, destr_function );
|
||||||
|
|
||||||
|
@ -1099,7 +1100,6 @@ DBMgr::getCountWhere( const char* table, string& test )
|
||||||
assert( 1 == PQntuples( result ) );
|
assert( 1 == PQntuples( result ) );
|
||||||
int count = atoi( PQgetvalue( result, 0, 0 ) );
|
int count = atoi( PQgetvalue( result, 0, 0 ) );
|
||||||
PQclear( result );
|
PQclear( result );
|
||||||
logf( XW_LOGINFO, "%s(%s)=>%d", __func__, query.c_str(), count );
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -203,13 +203,24 @@ parseRelayID( const unsigned char** const inp, const unsigned char* const end,
|
||||||
if ( ok ) {
|
if ( ok ) {
|
||||||
strncpy( buf, (char*)*inp, connNameLen );
|
strncpy( buf, (char*)*inp, connNameLen );
|
||||||
buf[connNameLen] = '\0';
|
buf[connNameLen] = '\0';
|
||||||
*hid = atoi( hidp+1 );
|
|
||||||
char* endptr;
|
char* endptr;
|
||||||
*hid = strtol( hidp + 1, &endptr, 10 );
|
*hid = strtol( hidp + 1, &endptr, 10 );
|
||||||
|
|
||||||
|
if ( *hid >= 0 && *hid <= 4 ) {
|
||||||
if ( '\n' == *endptr ) {
|
if ( '\n' == *endptr ) {
|
||||||
++endptr;
|
++endptr;
|
||||||
}
|
}
|
||||||
*inp = (unsigned char*)endptr;
|
*inp = (unsigned char*)endptr;
|
||||||
|
} else {
|
||||||
|
ok = false;
|
||||||
|
|
||||||
|
int len = end - *inp;
|
||||||
|
char buf[len+1];
|
||||||
|
memcpy( buf, *inp, len);
|
||||||
|
buf[len] = '\0';
|
||||||
|
logf( XW_LOGERROR, "%s: got bad hid %d from str \"%s\"", __func__,
|
||||||
|
*hid, buf );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( !ok ) {
|
if ( !ok ) {
|
||||||
logf( XW_LOGERROR, "%s failed", __func__ );
|
logf( XW_LOGERROR, "%s failed", __func__ );
|
||||||
|
|
Loading…
Add table
Reference in a new issue