mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-21 23:40:26 -04:00
Removed some std::ostringstream.
To be continued. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5103 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
60a68210d5
commit
83bd45caa4
22 changed files with 399 additions and 755 deletions
|
@ -229,33 +229,19 @@ bool p3BitDht::saveList(bool &cleanup, std::list<RsItem *> &saveList)
|
|||
int i;
|
||||
for(i = 0; i < RSDHT_RELAY_NUM_CLASS; i++)
|
||||
{
|
||||
std::ostringstream keyout;
|
||||
keyout << "RELAY_CLASS" << i;
|
||||
|
||||
std::string countkey = keyout.str() + "_COUNT";
|
||||
std::string bandkey = keyout.str() + "_BANDWIDTH";
|
||||
|
||||
std::ostringstream countout;
|
||||
std::ostringstream bandout;
|
||||
countout << mRelay->getRelayClassMax(i);
|
||||
bandout << mRelay->getRelayClassBandwidth(i);
|
||||
|
||||
kv.key = countkey;
|
||||
kv.value = countout.str();
|
||||
rs_sprintf(kv.key, "RELAY_CLASS%d_COUNT", i);
|
||||
rs_sprintf(kv.value, "%d", mRelay->getRelayClassMax(i));
|
||||
config->tlvkvs.pairs.push_back(kv);
|
||||
|
||||
kv.key = bandkey;
|
||||
kv.value = bandout.str();
|
||||
config->tlvkvs.pairs.push_back(kv);
|
||||
rs_sprintf(kv.key, "RELAY_CLASS%d_BANDWIDTH", i);
|
||||
rs_sprintf(kv.value, "%d", mRelay->getRelayClassBandwidth(i));
|
||||
config->tlvkvs.pairs.push_back(kv);
|
||||
}
|
||||
|
||||
/* add RelayMode */
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << mRelayMode;
|
||||
|
||||
kv.key = "RELAY_MODE";
|
||||
kv.value = out.str();
|
||||
kv.key = "RELAY_MODE";
|
||||
rs_sprintf(kv.value, "%lu", mRelayMode);
|
||||
config->tlvkvs.pairs.push_back(kv);
|
||||
}
|
||||
|
||||
|
@ -263,11 +249,8 @@ bool p3BitDht::saveList(bool &cleanup, std::list<RsItem *> &saveList)
|
|||
std::list<std::string>::iterator it;
|
||||
for(i = 0, it = mRelayServerList.begin(); it != mRelayServerList.end(); it++, i++)
|
||||
{
|
||||
std::ostringstream key;
|
||||
key << "RELAY_SERVER" << i;
|
||||
|
||||
kv.key = key.str();
|
||||
kv.value = *it;
|
||||
rs_sprintf(kv.key, "RELAY_SERVER%d", i);
|
||||
kv.value = *it;
|
||||
config->tlvkvs.pairs.push_back(kv);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue