diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-03-21 13:31:03 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-03-21 13:31:03 +0100 |
commit | c07b837dbad1ac176a6c18062dab9184e7080309 (patch) | |
tree | 277d5f7c06e2e71b25a9b9619917f04158b789e8 /src/Net | |
parent | 8f098fc3070f791302ec1f497588fab6ed409980 (diff) | |
download | mad-c07b837dbad1ac176a6c18062dab9184e7080309.tar mad-c07b837dbad1ac176a6c18062dab9184e7080309.zip |
Net::Connection-Klasse zur besseren Strukturierung gekapselt
Diffstat (limited to 'src/Net')
-rw-r--r-- | src/Net/ClientConnection.cpp | 2 | ||||
-rw-r--r-- | src/Net/Connection.cpp | 4 | ||||
-rw-r--r-- | src/Net/Connection.h | 13 |
3 files changed, 5 insertions, 14 deletions
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<void,Connection*,const Packet&> signal; + sigc::signal<void,const Packet&> 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<void,Connection*,const Packet&> signalReceive() const {return signal;} + sigc::signal<void,const Packet&> signalReceive() const {return signal;} static void init() { gnutls_global_init(); |