summaryrefslogtreecommitdiff
path: root/client/cprlisten.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/cprlisten.cc')
-rw-r--r--client/cprlisten.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/client/cprlisten.cc b/client/cprlisten.cc
index 0a4958e..4c1272e 100644
--- a/client/cprlisten.cc
+++ b/client/cprlisten.cc
@@ -32,11 +32,12 @@
#include <string>
using namespace std;
+#include "info.h"
+
#define MAGIC_STOP_STRING "SHUTTHEFUCKUP"
-CPRListen::CPRListen(Info *info, unsigned short port)
+CPRListen::CPRListen(unsigned short port)
{
- this->info = info;
this->port = port;
cpr = "N/A";
cprchanged = false;
@@ -55,13 +56,13 @@ void CPRListen::stop()
socket.connect("localhost", port);
socket.send_string(MAGIC_STOP_STRING);
} catch(Network_error &e) {
- info->error("In stop(): %s.", e.error.c_str());
+ gInfo::info->error("In stop(): %s.", e.error.c_str());
}
}
void CPRListen::thread_main()
{
- info->log("Listening for CPRs.");
+ gInfo::info->log("Listening for CPRs.");
while(running) {
try {
string newcpr;
@@ -76,15 +77,15 @@ void CPRListen::thread_main()
cprchanged = true;
cpr = newcpr;
mutex.unlock();
- info->log("Got CPR: %s.", cpr.c_str());
+ gInfo::info->log("Got CPR: %s.", cpr.c_str());
}
} catch(Network_error &e) {
- info->error("In thread_main(): %s.", e.error.c_str());
+ gInfo::info->error("In thread_main(): %s.", e.error.c_str());
running = false;
}
}
- info->log("Stopped listening for CPRs.");
+ gInfo::info->log("Stopped listening for CPRs.");
}
bool CPRListen::cprChanged()