summaryrefslogtreecommitdiffstats
path: root/src/Client/Requests
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-16 01:20:43 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-16 01:20:43 +0200
commitcc35771abf4fc7e0dd472bd818ff2b4962c7e204 (patch)
tree682bc38ffbf5954a93b1967a700f40bd78038ee4 /src/Client/Requests
parent2226256eedb2849f387ff566893a91bf5da3cdc9 (diff)
downloadmad-cc35771abf4fc7e0dd472bd818ff2b4962c7e204.tar
mad-cc35771abf4fc7e0dd472bd818ff2b4962c7e204.zip
Bessere Fehlerbehandlung
Diffstat (limited to 'src/Client/Requests')
-rw-r--r--src/Client/Requests/CoreStatusRequest.cpp9
-rw-r--r--src/Client/Requests/CoreStatusRequest.h2
-rw-r--r--src/Client/Requests/DaemonListRequest.cpp9
-rw-r--r--src/Client/Requests/DaemonListRequest.h2
-rw-r--r--src/Client/Requests/DaemonStatusRequest.cpp9
-rw-r--r--src/Client/Requests/DaemonStatusRequest.h2
6 files changed, 18 insertions, 15 deletions
diff --git a/src/Client/Requests/CoreStatusRequest.cpp b/src/Client/Requests/CoreStatusRequest.cpp
index 1c477b8..93552f6 100644
--- a/src/Client/Requests/CoreStatusRequest.cpp
+++ b/src/Client/Requests/CoreStatusRequest.cpp
@@ -44,14 +44,15 @@ bool CoreStatusRequest::sendRequest(Net::Connection *connection, uint16_t reques
return true;
}
-bool CoreStatusRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::OK)
- return false; // TODO Logging
+void CoreStatusRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
+ if(packet.getType() != Net::Packet::OK) {
+ signalFinished().emit();
+ return; // TODO Logging
+ }
finished(Net::Packets::HostStatusPacket(packet));
signalFinished().emit();
- return true;
}
}
diff --git a/src/Client/Requests/CoreStatusRequest.h b/src/Client/Requests/CoreStatusRequest.h
index 55d6a22..ff9bdc1 100644
--- a/src/Client/Requests/CoreStatusRequest.h
+++ b/src/Client/Requests/CoreStatusRequest.h
@@ -45,7 +45,7 @@ class CoreStatusRequest : public Common::Request {
static bool send(Net::Connection *connection, const sigc::slot<void,const Net::Packets::HostStatusPacket&> &callback);
virtual bool sendRequest(Net::Connection *connection, uint16_t requestId);
- virtual bool handlePacket(Net::Connection*, const Net::Packet &packet);
+ virtual void handlePacket(Net::Connection*, const Net::Packet &packet);
};
}
diff --git a/src/Client/Requests/DaemonListRequest.cpp b/src/Client/Requests/DaemonListRequest.cpp
index 97ee335..cc6d353 100644
--- a/src/Client/Requests/DaemonListRequest.cpp
+++ b/src/Client/Requests/DaemonListRequest.cpp
@@ -44,14 +44,15 @@ bool DaemonListRequest::sendRequest(Net::Connection *connection, uint16_t reques
return true;
}
-bool DaemonListRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::OK)
- return false; // TODO Logging
+void DaemonListRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
+ if(packet.getType() != Net::Packet::OK) {
+ signalFinished().emit();
+ return; // TODO Logging
+ }
finished(Net::Packets::NameListPacket(packet));
signalFinished().emit();
- return true;
}
}
diff --git a/src/Client/Requests/DaemonListRequest.h b/src/Client/Requests/DaemonListRequest.h
index 1a820d7..9a11d19 100644
--- a/src/Client/Requests/DaemonListRequest.h
+++ b/src/Client/Requests/DaemonListRequest.h
@@ -45,7 +45,7 @@ class DaemonListRequest : public Common::Request {
static bool send(Net::Connection *connection, const sigc::slot<void,const Net::Packets::NameListPacket&> &callback);
virtual bool sendRequest(Net::Connection *connection, uint16_t requestId);
- virtual bool handlePacket(Net::Connection*, const Net::Packet &packet);
+ virtual void handlePacket(Net::Connection*, const Net::Packet &packet);
};
}
diff --git a/src/Client/Requests/DaemonStatusRequest.cpp b/src/Client/Requests/DaemonStatusRequest.cpp
index 8308e96..7a7b47e 100644
--- a/src/Client/Requests/DaemonStatusRequest.cpp
+++ b/src/Client/Requests/DaemonStatusRequest.cpp
@@ -44,14 +44,15 @@ bool DaemonStatusRequest::sendRequest(Net::Connection *connection, uint16_t requ
return true;
}
-bool DaemonStatusRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::OK)
- return false; // TODO Logging
+void DaemonStatusRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
+ if(packet.getType() != Net::Packet::OK) {
+ signalFinished().emit();
+ return; // TODO Logging
+ }
finished(Net::Packets::HostStatusPacket(packet));
signalFinished().emit();
- return true;
}
}
diff --git a/src/Client/Requests/DaemonStatusRequest.h b/src/Client/Requests/DaemonStatusRequest.h
index 0aff41b..34d3a90 100644
--- a/src/Client/Requests/DaemonStatusRequest.h
+++ b/src/Client/Requests/DaemonStatusRequest.h
@@ -48,7 +48,7 @@ class DaemonStatusRequest : public Common::Request {
static bool send(Net::Connection *connection, const sigc::slot<void,const Net::Packets::HostStatusPacket&> &callback, const std::string &daemon0);
virtual bool sendRequest(Net::Connection *connection, uint16_t requestId);
- virtual bool handlePacket(Net::Connection*, const Net::Packet &packet);
+ virtual void handlePacket(Net::Connection*, const Net::Packet &packet);
};
}