← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3263: trim HTTP errors

 

------------------------------------------------------------
revno: 3263
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2013-04-16 19:13:02 +0200
message:
  trim HTTP errors
modified:
  dcpp/HttpConnection.cpp


--
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 'dcpp/HttpConnection.cpp'
--- dcpp/HttpConnection.cpp	2013-04-14 22:01:23 +0000
+++ dcpp/HttpConnection.cpp	2013-04-16 17:13:02 +0000
@@ -25,6 +25,8 @@
 #include "TimerManager.h"
 #include "version.h"
 
+#include <boost/algorithm/string/trim.hpp>
+
 namespace dcpp {
 
 static const std::string CORAL_SUFFIX = ".nyud.net";
@@ -209,7 +211,7 @@
 		} else {
 			abortRequest(true);
 			connState = CONN_FAILED;
-			fire(HttpConnectionListener::Failed(), this, str(F_("%1% (%2%)") % aLine % url));
+			fire(HttpConnectionListener::Failed(), this, str(F_("%1% (%2%)") % boost::trim_copy(aLine) % url));
 		}
 
 	} else if(connState == CONN_MOVED && Util::findSubString(aLine, "Location") != string::npos) {
@@ -265,7 +267,7 @@
 void HttpConnection::on(BufferedSocketListener::Failed, const string& aLine) noexcept {
 	abortRequest(false);
 	connState = CONN_FAILED;
-	fire(HttpConnectionListener::Failed(), this, str(F_("%1% (%2%)") % aLine % url));
+	fire(HttpConnectionListener::Failed(), this, str(F_("%1% (%2%)") % boost::trim_copy(aLine) % url));
 }
 
 void HttpConnection::on(BufferedSocketListener::ModeChange) noexcept {