From 09b8df5200de1c8c20ea2856a8c6aa76b0811bd1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 11 Sep 2009 23:13:23 +0200 Subject: Connection: Allow setting a receive limit --- src/Server/ConnectionManager.cpp | 17 +++-------------- src/Server/ConnectionManager.h | 2 -- 2 files changed, 3 insertions(+), 16 deletions(-) (limited to 'src/Server') diff --git a/src/Server/ConnectionManager.cpp b/src/Server/ConnectionManager.cpp index ad5a7d3..1ffd3f1 100644 --- a/src/Server/ConnectionManager.cpp +++ b/src/Server/ConnectionManager.cpp @@ -64,23 +64,12 @@ boost::shared_ptr ConnectionManager::ServerConnection authContext = application->getAuthManager()->authenticate(method, subMethod, user, data, response, authContext); - return authContext; -} - -/*void* ConnectionManager::ServerConnection::getCertificate(size_t *size) const { - const gnutls_datum_t *cert = connection->getCertificate(); + if(authContext->isAuthenticated()) + connection->setReceiveLimit(0xFFFFFFFF); // 4 Gigs - *size = cert->size; - return cert->data; + return authContext; } -void* ConnectionManager::ServerConnection::getPeerCertificate(size_t *size) const { - const gnutls_datum_t *cert = connection->getPeerCertificate(); - - *size = cert->size; - return cert->data; -}*/ - boost::asio::ip::tcp::endpoint ConnectionManager::parseAddress(const std::string &str) throw(Core::Exception) { try { if(str == "*") diff --git a/src/Server/ConnectionManager.h b/src/Server/ConnectionManager.h index 099072c..8c989b9 100644 --- a/src/Server/ConnectionManager.h +++ b/src/Server/ConnectionManager.h @@ -73,8 +73,6 @@ class MAD_SERVER_EXPORT ConnectionManager : public Core::Configurable, private b bool isConnected() const; virtual bool disconnect(); - //virtual void* getCertificate(size_t *size) const; - //virtual void* getPeerCertificate(size_t *size) const; ConnectionType getConnectionType() const { return type; -- cgit v1.2.3