mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-18 04:19:55 +01:00
Add some debugging code to the tagreader worker that makes it crash randomly.
This commit is contained in:
parent
396f375e8d
commit
84a1ae2f87
@ -24,6 +24,7 @@
|
||||
#include <QStringList>
|
||||
|
||||
#include <iostream>
|
||||
#include <sys/time.h>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
QCoreApplication a(argc, argv);
|
||||
@ -36,6 +37,11 @@ int main(int argc, char** argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Seed random number generator
|
||||
timeval time;
|
||||
gettimeofday(&time,NULL);
|
||||
qsrand((time.tv_sec * 1000) + (time.tv_usec / 1000));
|
||||
|
||||
logging::Init();
|
||||
qLog(Info) << "TagReader worker connecting to" << args[1];
|
||||
|
||||
|
@ -100,6 +100,14 @@ TagReaderWorker::TagReaderWorker(QIODevice* socket, QObject* parent)
|
||||
void TagReaderWorker::MessageArrived(const pb::tagreader::Message& message) {
|
||||
pb::tagreader::Message reply;
|
||||
|
||||
#if 0
|
||||
// Crash every few requests
|
||||
if (qrand() % 10 == 0) {
|
||||
qLog(Debug) << "Crashing on request ID" << message.id();
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (message.has_read_file_request()) {
|
||||
ReadFile(QStringFromStdString(message.read_file_request().filename()),
|
||||
reply.mutable_read_file_response()->mutable_metadata());
|
||||
|
Loading…
Reference in New Issue
Block a user