mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 15:41:24 +02:00
- some coverity based cleanups
This commit is contained in:
@@ -2188,12 +2188,15 @@ void BroadCastClientSocketThread::execute() {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
try {
|
||||
char buff[10024]=""; // Buffers the data to be broadcasted.
|
||||
char buff[10025]=""; // Buffers the data to be broadcasted.
|
||||
// Keep getting packets forever.
|
||||
for( time_t elapsed = time(NULL); difftime((long int)time(NULL),elapsed) <= 5; ) {
|
||||
alen = sizeof(struct sockaddr);
|
||||
int nb=0;// The number of bytes read.
|
||||
bool gotData = (nb = recvfrom(bcfd, buff, 10024, 0, (struct sockaddr *) &bcSender, &alen)) > 0;
|
||||
if(nb >= 0) {
|
||||
buff[nb]=0;
|
||||
}
|
||||
|
||||
//printf("Broadcasting client nb = %d buff [%s] gotData = %d\n",nb,buff,gotData);
|
||||
|
||||
|
@@ -103,7 +103,7 @@ public:
|
||||
BaseThread *base_thread = dynamic_cast<BaseThread *>(thread);
|
||||
if(base_thread != NULL &&
|
||||
(base_thread->getRunningStatus() == true || base_thread->getExecutingTask() == true)) {
|
||||
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,(base_thread != NULL ? base_thread->getUniqueID().c_str() : "n/a"));
|
||||
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,base_thread->getUniqueID().c_str());
|
||||
|
||||
base_thread->signalQuit();
|
||||
sleep(10);
|
||||
|
Reference in New Issue
Block a user