murik
|
2013-10-21
, 17:27
|
Posts: 164 |
Thanked: 64 times |
Joined on May 2013
|
#4401
|
|
2013-10-21
, 18:09
|
Posts: 10 |
Thanked: 0 times |
Joined on Oct 2013
@ panchkula
|
#4402
|
|
2013-10-21
, 18:32
|
Posts: 59 |
Thanked: 47 times |
Joined on Aug 2012
|
#4403
|
|
2013-10-23
, 13:14
|
Posts: 184 |
Thanked: 75 times |
Joined on Mar 2011
@ UK
|
#4404
|
|
2013-10-23
, 13:18
|
|
Posts: 1,396 |
Thanked: 2,796 times |
Joined on Sep 2010
@ Caracas, Venezuela
|
#4405
|
@Scorpius
Hi there,
I remember you saying you will be working on bbm once its released. Are you still going to work on it?
thx
|
2013-10-25
, 03:04
|
|
Posts: 113 |
Thanked: 334 times |
Joined on Oct 2010
@ Argentina
|
#4406
|
void BinTreeNodeReader::fillArray(QByteArray& buffer, quint32 len) { Utilities::logData("Debug: BinTreeNodeReader::fillArray"); char data[1025]; buffer.clear(); // bool ready = true; /* if (socket->bytesAvailable() < 1) { Utilities::logData("fillArray() waiting for bytes"); ready = socket->waitForReadyRead(READ_TIMEOUT); } if (!ready) { Utilities::logData("fillArray() not ready / timed out"); throw IOException(socket->error()); } */ int needToRead = len; while (needToRead > 0) { Utilities::logData("Debug: BinTreeNodeReader::fillArray--loop"); int bytesRead = socket->read(data,(needToRead > 1024) ? 1024 : needToRead); if (bytesRead < 0) throw IOException(socket->error()); if (bytesRead == 0) // socket->waitForReadyRead(READ_TIMEOUT); qApp->processEvents(); else { needToRead -= bytesRead; buffer.append(data,bytesRead); } } }
|
2013-10-25
, 03:23
|
|
Posts: 1,396 |
Thanked: 2,796 times |
Joined on Sep 2010
@ Caracas, Venezuela
|
#4407
|
It looks like when there is some sort of connection problem, it nevers exists the while loop and there is no sleep function called, so Yappri eats the CPU. As you can see I added some log messages, when the problem arouse, in minutes the log file grew 26MB large, until I ran out of disk space. I'll patch the code and see if it happens again.
|
2013-10-25
, 03:34
|
|
Posts: 113 |
Thanked: 334 times |
Joined on Oct 2010
@ Argentina
|
#4408
|
|
2013-10-25
, 18:42
|
Community Council |
Posts: 685 |
Thanked: 1,235 times |
Joined on Sep 2010
@ Mbabane
|
#4409
|
Hi Scorpius, I think I found the problem causing Yappari to consume too much CPU, the problem is located here:Code:void BinTreeNodeReader::fillArray(QByteArray& buffer, quint32 len) { Utilities::logData("Debug: BinTreeNodeReader::fillArray"); char data[1025]; buffer.clear(); // bool ready = true; /* if (socket->bytesAvailable() < 1) { Utilities::logData("fillArray() waiting for bytes"); ready = socket->waitForReadyRead(READ_TIMEOUT); } if (!ready) { Utilities::logData("fillArray() not ready / timed out"); throw IOException(socket->error()); } */ int needToRead = len; while (needToRead > 0) { Utilities::logData("Debug: BinTreeNodeReader::fillArray--loop"); int bytesRead = socket->read(data,(needToRead > 1024) ? 1024 : needToRead); if (bytesRead < 0) throw IOException(socket->error()); if (bytesRead == 0) // socket->waitForReadyRead(READ_TIMEOUT); qApp->processEvents(); else { needToRead -= bytesRead; buffer.append(data,bytesRead); } } }
|
2013-10-25
, 18:53
|
|
Posts: 1,396 |
Thanked: 2,796 times |
Joined on Sep 2010
@ Caracas, Venezuela
|
#4410
|
Tags |
alpha, awesomeness, best_client, let_it_die, mumbai_dumbai, read_first_post, whatsapp |
|