From c07b837dbad1ac176a6c18062dab9184e7080309 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 21 Mar 2009 13:31:03 +0100 Subject: Net::Connection-Klasse zur besseren Strukturierung gekapselt --- src/Net/ClientConnection.cpp | 2 -- src/Net/Connection.cpp | 4 ++-- src/Net/Connection.h | 13 +++---------- 3 files changed, 5 insertions(+), 14 deletions(-) (limited to 'src/Net') diff --git a/src/Net/ClientConnection.cpp b/src/Net/ClientConnection.cpp index 75a9ad6..31c1a08 100644 --- a/src/Net/ClientConnection.cpp +++ b/src/Net/ClientConnection.cpp @@ -68,8 +68,6 @@ void ClientConnection::connect(const IPAddress &address, bool daemon0) throw(Com if(peer) delete peer; peer = new IPAddress(address); - authenticated = false; - identified = false; if(::connect(sock, peer->getSockAddr(), peer->getSockAddrLength()) < 0) { close(sock); diff --git a/src/Net/Connection.cpp b/src/Net/Connection.cpp index 9b6b87b..0984f0a 100644 --- a/src/Net/Connection.cpp +++ b/src/Net/Connection.cpp @@ -124,7 +124,7 @@ void Connection::packetHeaderReceiveHandler(const void *data, unsigned long leng header = *(const Packet::Data*)data; if(header.length == 0) { - signal(this, Packet(ntohs(header.requestId))); + signal(Packet(ntohs(header.requestId))); enterReceiveLoop(); } @@ -144,7 +144,7 @@ void Connection::packetDataReceiveHandler(const void *data, unsigned long length return; } - signal(this, Packet(ntohs(header.requestId), data, length)); + signal(Packet(ntohs(header.requestId), data, length)); enterReceiveLoop(); } diff --git a/src/Net/Connection.h b/src/Net/Connection.h index 0d7e6cf..695fbb8 100644 --- a/src/Net/Connection.h +++ b/src/Net/Connection.h @@ -54,7 +54,7 @@ class Connection { Packet::Data header; - sigc::signal signal; + sigc::signal signal; void doHandshake(); @@ -98,7 +98,6 @@ class Connection { gnutls_certificate_credentials_t x509_cred; IPAddress *peer; - bool authenticated, identified; void handshake(); @@ -110,7 +109,7 @@ class Connection { bool enterReceiveLoop(); public: - Connection() : state(DISCONNECTED), peer(0), authenticated(false), identified(false) { + Connection() : state(DISCONNECTED), peer(0) { transR.length = transR.transmitted = 0; transR.data = 0; @@ -128,12 +127,6 @@ class Connection { return (state == DISCONNECT || state == BYE); } - bool isAuthenticated() const {return authenticated;} - void setAuthenticated() {authenticated = true;} - - bool isIdentified() const {return identified;} - void setIdentified() {identified = true;} - const gnutls_datum_t* getCertificate() { return gnutls_certificate_get_ours(session); } @@ -154,7 +147,7 @@ class Connection { bool sendQueueEmpty() const {return transS.empty();} - sigc::signal signalReceive() const {return signal;} + sigc::signal signalReceive() const {return signal;} static void init() { gnutls_global_init(); -- cgit v1.2.3