mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-26 09:58:20 +01:00
add mutex for reconns too; log socket and ip addr connecting on it
This commit is contained in:
parent
5ea1f3b470
commit
8e5abb189b
1 changed files with 6 additions and 2 deletions
|
@ -363,6 +363,9 @@ processReconnect( unsigned char* bufp, int bufLen, int socket )
|
|||
&& getNetShort( &bufp, end, &gameSeed )
|
||||
&& readStr( &bufp, end, connName, sizeof(connName) ) ) {
|
||||
|
||||
static pthread_mutex_t s_newCookieLock = PTHREAD_MUTEX_INITIALIZER;
|
||||
MutexLock ml( &s_newCookieLock );
|
||||
|
||||
SafeCref scr( cookie[0]? cookie : NULL,
|
||||
connName[0]? connName : NULL,
|
||||
srcID, socket, nPlayersH,
|
||||
|
@ -903,8 +906,9 @@ main( int argc, char** argv )
|
|||
int newSock = accept( listener, (sockaddr*)&newaddr,
|
||||
&siz );
|
||||
|
||||
logf( XW_LOGINFO, "accepting connection from %s",
|
||||
inet_ntoa(newaddr.sin_addr) );
|
||||
logf( XW_LOGINFO,
|
||||
"accepting connection from %s on socket %d",
|
||||
inet_ntoa(newaddr.sin_addr), newSock );
|
||||
|
||||
tPool->AddSocket( newSock );
|
||||
--retval;
|
||||
|
|
Loading…
Reference in a new issue