Removed some std::ostringstream.

To be continued.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5108 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-04-18 00:00:59 +00:00
parent b2ea453804
commit 9aee68a2a9
8 changed files with 140 additions and 233 deletions

View file

@ -27,9 +27,9 @@
#include "retroshare/rsconfig.h"
#include "util/rsrandom.h"
#include "util/rsstring.h"
#include <iostream>
#include <sstream>
/**
*
@ -241,22 +241,22 @@ void PeerConnectStateBox::stateMsg(std::ostream &out, std::string msg, uint32_t
std::string PeerConnectStateBox::connectState() const
{
std::string str = StateAsString(mState);
std::ostringstream out;
time_t now = time(NULL);
out << str << "(" << mNoAttempts << "/" << mNoFailedAttempts << ") for " << now - mStateTS << " secs";
std::string out;
rs_sprintf(out, "%s(%lu/%lu) for %ld secs", str.c_str(), mNoAttempts, mNoFailedAttempts, now - mStateTS);
if ( (mState == CSB_CONNECTED) || (mState == CSB_DIRECT_ATTEMPT) ||
(mState == CSB_PROXY_ATTEMPT) || (mState == CSB_RELAY_ATTEMPT) ||
(mState == CSB_FAILED_WAIT) )
{
out << " Last Attempt: " << mAttemptLength;
rs_sprintf_append(out, " Last Attempt: %ld", mAttemptLength);
}
else
{
out << " LA: " << mAttemptLength;
out << " NextAttempt: " << mNextAttemptTS - now;
rs_sprintf_append(out, " LA: %ld", mAttemptLength);
rs_sprintf_append(out, " NextAttempt: %ld", mNextAttemptTS - now);
}
return out.str();
return out;
}