← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2656: Fix the "Close disconnected hubs" command

 

------------------------------------------------------------
revno: 2656
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2011-10-28 21:29:51 +0200
message:
  Fix the "Close disconnected hubs" command
modified:
  changelog.txt
  dcpp/Client.cpp
  dcpp/Client.h


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'changelog.txt'
--- changelog.txt	2011-10-24 14:01:30 +0000
+++ changelog.txt	2011-10-28 19:29:51 +0000
@@ -47,7 +47,7 @@
 * Handle GeoIP database updates from within the program (iceman50, poy)
 * [L#783516] ZLIF compression support (iceman50)
 * Increase minimum download segment size from 64KiB to 256KiB (cologic)
-
+* [L#874282] Fix the "Close disconnected hubs" command (poy)
 
 -- 0.782 2011-03-05 --
 * Prevent a remote crash triggered via malformed user commands (poy)

=== modified file 'dcpp/Client.cpp'
--- dcpp/Client.cpp	2011-10-22 16:41:13 +0000
+++ dcpp/Client.cpp	2011-10-28 19:29:51 +0000
@@ -114,7 +114,7 @@
 }
 
 void Client::send(const char* aMessage, size_t aLen) {
-	if(!isReady()) {
+	if(!isConnected()) {
 		dcassert(0);
 		return;
 	}
@@ -157,19 +157,19 @@
 }
 
 bool Client::isSecure() const {
-	return isReady() && sock->isSecure();
+	return isConnected() && sock->isSecure();
 }
 
 bool Client::isTrusted() const {
-	return isReady() && sock->isTrusted();
+	return isConnected() && sock->isTrusted();
 }
 
 std::string Client::getCipherName() const {
-	return isReady() ? sock->getCipherName() : Util::emptyString;
+	return isConnected() ? sock->getCipherName() : Util::emptyString;
 }
 
 vector<uint8_t> Client::getKeyprint() const {
-	return isReady() ? sock->getKeyprint() : vector<uint8_t>();
+	return isConnected() ? sock->getKeyprint() : vector<uint8_t>();
 }
 
 void Client::updateCounts(bool aRemove) {

=== modified file 'dcpp/Client.h'
--- dcpp/Client.h	2011-10-14 03:13:26 +0000
+++ dcpp/Client.h	2011-10-28 19:29:51 +0000
@@ -54,8 +54,7 @@
 
 	virtual void send(const AdcCommand& command) = 0;
 
-	bool isConnected() const { return state != STATE_DISCONNECTED; }
-	bool isReady() const { return state != STATE_CONNECTING && state != STATE_DISCONNECTED; }
+	bool isConnected() const { return state != STATE_CONNECTING && state != STATE_DISCONNECTED; }
 	bool isSecure() const;
 	bool isTrusted() const;
 	std::string getCipherName() const;