- some coverity based cleanups

This commit is contained in:
SoftCoder
2017-10-08 20:31:42 -07:00
parent 9de36c32a3
commit d78f28983b
4 changed files with 11 additions and 2 deletions

View File

@@ -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);

View File

@@ -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);