diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-09-17 05:33:01 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-09-17 05:33:01 +0200 |
commit | 039c218a7b1f2eae4f8e8305bc8e8bf70a67beab (patch) | |
tree | 362a59253abd77b5e41800d73a7c5dacf18617f7 /src/Common/Requests/GSSAPIAuthRequest.cpp | |
parent | a0cffb5475d35f0a19b95af2ce56bf6c90c82256 (diff) | |
download | mad-039c218a7b1f2eae4f8e8305bc8e8bf70a67beab.tar mad-039c218a7b1f2eae4f8e8305bc8e8bf70a67beab.zip |
Interface der Request-Klassen verbessert; muss noch vereinfacht werden
Diffstat (limited to 'src/Common/Requests/GSSAPIAuthRequest.cpp')
-rw-r--r-- | src/Common/Requests/GSSAPIAuthRequest.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/Common/Requests/GSSAPIAuthRequest.cpp b/src/Common/Requests/GSSAPIAuthRequest.cpp index 91488d0..53d969f 100644 --- a/src/Common/Requests/GSSAPIAuthRequest.cpp +++ b/src/Common/Requests/GSSAPIAuthRequest.cpp @@ -18,7 +18,7 @@ */ #include "GSSAPIAuthRequest.h" -#include "../RequestManager.h" +#include <Net/Connection.h> #include <cstring> @@ -37,17 +37,7 @@ GSSAPIAuthRequest::~GSSAPIAuthRequest() { gss_release_name(&minStat, &gssServiceName); } -bool GSSAPIAuthRequest::send(Net::Connection *connection, const std::string &serviceName0) { - GSSAPIAuthRequest *request = new GSSAPIAuthRequest(serviceName0); - - if(Mad::Common::RequestManager::getRequestManager()->sendRequest(connection, request)) - return true; - - delete request; - return false; -} - -bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t requestId) { +void GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t requestId) { OM_uint32 majStat, minStat; gss_buffer_desc buffer; @@ -61,7 +51,7 @@ bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t reques if(majStat != GSS_S_COMPLETE) { gssServiceName = GSS_C_NO_NAME; - return false; + return; } majStat = gss_init_sec_context(&minStat, GSS_C_NO_CREDENTIAL, &gssContext, gssServiceName, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG, @@ -73,22 +63,20 @@ bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t reques } else if(majStat != GSS_S_CONTINUE_NEEDED) { gss_release_buffer(&minStat, &buffer); - return false; + return; } if(!connection->send(Net::Packet(Net::Packet::GSSAPI_AUTH, requestId, buffer.value, buffer.length))) { gss_release_buffer(&minStat, &buffer); - return false; + return; } gss_release_buffer(&minStat, &buffer); - - return true; } void GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Packet &packet) { if(packet.getType() != Net::Packet::GSSAPI_AUTH) { - signalFinished().emit(); + finishWithError(Exception(Exception::UNEXPECTED_PACKET)); return; // TODO Logging } @@ -157,7 +145,7 @@ void GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Pac gss_release_buffer(&minStat, &sendBuffer); - signalFinished().emit(); + finish(); } } |