summaryrefslogtreecommitdiffstats
path: root/src/Common/Requests
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Requests')
-rw-r--r--src/Common/Requests/DisconnectRequest.cpp9
-rw-r--r--src/Common/Requests/GSSAPIAuthRequest.cpp9
-rw-r--r--src/Common/Requests/IdentifyRequest.cpp9
3 files changed, 3 insertions, 24 deletions
diff --git a/src/Common/Requests/DisconnectRequest.cpp b/src/Common/Requests/DisconnectRequest.cpp
index 0b6e3bc..090b840 100644
--- a/src/Common/Requests/DisconnectRequest.cpp
+++ b/src/Common/Requests/DisconnectRequest.cpp
@@ -37,20 +37,13 @@ bool DisconnectRequest::send(Net::Connection *connection, const sigc::slot<void>
}
bool DisconnectRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
- if(isSent())
- return false;
-
if(!connection->send(Net::Packet(Net::Packet::DISCONNECT, requestId)))
return false;
- setSent();
return true;
}
bool DisconnectRequest::handlePacket(Net::Connection *connection, const Net::Packet &packet) {
- if(isFinished())
- return false;
-
if(packet.getType() != Net::Packet::OK)
return false; // TODO Logging
@@ -58,7 +51,7 @@ bool DisconnectRequest::handlePacket(Net::Connection *connection, const Net::Pac
finished();
- setFinished();
+ signalFinished().emit();
return true;
}
diff --git a/src/Common/Requests/GSSAPIAuthRequest.cpp b/src/Common/Requests/GSSAPIAuthRequest.cpp
index 705db41..a4a1b17 100644
--- a/src/Common/Requests/GSSAPIAuthRequest.cpp
+++ b/src/Common/Requests/GSSAPIAuthRequest.cpp
@@ -48,9 +48,6 @@ bool GSSAPIAuthRequest::send(Net::Connection *connection, const std::string &ser
}
bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
- if(isSent())
- return false;
-
OM_uint32 majStat, minStat;
gss_buffer_desc buffer;
@@ -86,14 +83,10 @@ bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t reques
gss_release_buffer(&minStat, &buffer);
- setSent();
return true;
}
bool GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Packet &packet) {
- if(isFinished())
- return false;
-
if(packet.getType() != Net::Packet::GSSAPI_AUTH)
return false; // TODO Logging
@@ -160,7 +153,7 @@ bool GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Pac
gss_release_buffer(&minStat, &sendBuffer);
- setFinished();
+ signalFinished().emit();
}
return true;
diff --git a/src/Common/Requests/IdentifyRequest.cpp b/src/Common/Requests/IdentifyRequest.cpp
index 54d49e2..9214baf 100644
--- a/src/Common/Requests/IdentifyRequest.cpp
+++ b/src/Common/Requests/IdentifyRequest.cpp
@@ -36,24 +36,17 @@ bool IdentifyRequest::send(Net::Connection *connection, const std::string &hostn
}
bool IdentifyRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
- if(isSent())
- return false;
-
if(!connection->send(Net::Packet(Net::Packet::IDENTIFY, requestId, hostname.c_str(), hostname.length())))
return false;
- setSent();
return true;
}
bool IdentifyRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
- if(isFinished())
- return false;
-
if(packet.getType() != Net::Packet::OK)
return false; // TODO Logging
- setFinished();
+ signalFinished().emit();
return true;
}