mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 22:40:36 -04:00
Removed some std::ostringstream.
To be continued. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5111 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a9e496f845
commit
4e26884646
14 changed files with 190 additions and 131 deletions
|
@ -269,10 +269,7 @@ void p3BitDht::getRelayRates(float &read, float &write, float &relay)
|
|||
|
||||
void convertBdPeerToRsDhtPeer(RsDhtPeer &peer, const bdPeer &int_peer)
|
||||
{
|
||||
std::ostringstream out;
|
||||
bdStdPrintNodeId(out, &(int_peer.mPeerId.id));
|
||||
|
||||
peer.mDhtId = out.str();
|
||||
bdStdPrintNodeId(peer.mDhtId, &(int_peer.mPeerId.id), false);
|
||||
|
||||
rs_sprintf(peer.mAddr, "%s:%u", rs_inet_ntoa(int_peer.mPeerId.addr.sin_addr).c_str(), ntohs(int_peer.mPeerId.addr.sin_port));
|
||||
|
||||
|
@ -287,10 +284,8 @@ void convertBdPeerToRsDhtPeer(RsDhtPeer &peer, const bdPeer &int_peer)
|
|||
|
||||
void convertDhtPeerDetailsToRsDhtNetPeer(RsDhtNetPeer &status, const DhtPeerDetails &details)
|
||||
{
|
||||
std::ostringstream out;
|
||||
bdStdPrintId(out, &(details.mDhtId));
|
||||
bdStdPrintId(status.mDhtId, &(details.mDhtId), false);
|
||||
|
||||
status.mDhtId = out.str();
|
||||
status.mRsId = details.mRsId;
|
||||
|
||||
status.mPeerType = details.mPeerType;
|
||||
|
@ -320,9 +315,7 @@ void convertDhtPeerDetailsToRsDhtNetPeer(RsDhtNetPeer &status, const DhtPeerDeta
|
|||
}
|
||||
|
||||
//status.mPeerConnectProxyId = details.mPeerConnectProxyId;
|
||||
std::ostringstream out2;
|
||||
bdStdPrintId(out2, &(details.mPeerConnectProxyId));
|
||||
status.mPeerConnectProxyId = out2.str();
|
||||
bdStdPrintId(status.mPeerConnectProxyId, &(details.mPeerConnectProxyId), false);
|
||||
|
||||
status.mCbPeerMsg = details.mPeerCbMsg;
|
||||
|
||||
|
|
|
@ -167,9 +167,8 @@ int p3BitDht::NodeCallback(const bdId *id, uint32_t peerflags)
|
|||
|
||||
int p3BitDht::PeerCallback(const bdId *id, uint32_t status)
|
||||
{
|
||||
//std::ostringstream str;
|
||||
//std::string str;
|
||||
//bdStdPrintNodeId(str, &(id->id));
|
||||
//std::string strId = str.str();
|
||||
|
||||
//std::cerr << "p3BitDht::dhtPeerCallback()";
|
||||
//std::cerr << std::endl;
|
||||
|
@ -628,9 +627,8 @@ int p3BitDht::ConnectCallback(const bdId *srcId, const bdId *proxyId, const bdId
|
|||
/* if we get here, we are an endpoint (peer specified in peerId) */
|
||||
|
||||
/* translate id into string for exclusive mode */
|
||||
std::ostringstream idstr;
|
||||
bdStdPrintNodeId(idstr, &(peerId.id));
|
||||
std::string pid = idstr.str();
|
||||
std::string pid;
|
||||
bdStdPrintNodeId(pid, &(peerId.id), false);
|
||||
|
||||
switch(cbtype)
|
||||
{
|
||||
|
@ -1173,9 +1171,8 @@ int p3BitDht::doActions()
|
|||
bool grabbedExclusivePort = false;
|
||||
|
||||
/* translate id into string for exclusive mode */
|
||||
std::ostringstream idstr;
|
||||
bdStdPrintNodeId(idstr, &(action.mDestId.id));
|
||||
std::string pid = idstr.str();
|
||||
std::string pid;
|
||||
bdStdPrintNodeId(pid, &(action.mDestId.id), false);
|
||||
|
||||
|
||||
// Parameters that will be used for the Connect Request.
|
||||
|
@ -2004,13 +2001,11 @@ int p3BitDht::installRelayConnection(const bdId *srcId, const bdId *destId, uint
|
|||
int relayClass = UDP_RELAY_CLASS_GENERAL;
|
||||
|
||||
#ifdef DEBUG_PEERNET
|
||||
std::ostringstream str;
|
||||
bdStdPrintNodeId(str, &(srcId->id));
|
||||
std::string strId1 = str.str();
|
||||
std::string strId1;
|
||||
bdStdPrintNodeId(strId1, &(srcId->id), false);
|
||||
|
||||
str.clear();
|
||||
bdStdPrintNodeId(str, &(destId->id));
|
||||
std::string strId2 = str.str();
|
||||
std::string strId2;
|
||||
bdStdPrintNodeId(strId2, &(destId->id), false);
|
||||
#endif
|
||||
|
||||
/* grab a socket */
|
||||
|
@ -2334,9 +2329,8 @@ void p3BitDht::ReleaseProxyExclusiveMode_locked(DhtPeerDetails *dpd, bool addrCh
|
|||
std::cerr << std::endl;
|
||||
|
||||
/* translate id into string for exclusive mode */
|
||||
std::ostringstream idstr;
|
||||
bdStdPrintNodeId(idstr, &(dpd->mDhtId.id));
|
||||
std::string pid = idstr.str();
|
||||
std::string pid;
|
||||
bdStdPrintNodeId(pid, &(dpd->mDhtId.id), false);
|
||||
|
||||
|
||||
if (dpd->mExclusiveProxyLock)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue