mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 14:45:12 -04:00
Fixed inconsistent code (Patch rom G10H4ck)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7821 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4704cc122d
commit
8129d0c5d4
1 changed files with 11 additions and 14 deletions
|
@ -143,9 +143,9 @@ int UdpRelayReceiver::removeUdpPeer(UdpPeer *peer)
|
||||||
{
|
{
|
||||||
if (it->second == peer)
|
if (it->second == peer)
|
||||||
{
|
{
|
||||||
|
realPeerAddr = it->first;
|
||||||
mPeers.erase(it);
|
mPeers.erase(it);
|
||||||
found = true;
|
found = true;
|
||||||
realPeerAddr = it->first;
|
|
||||||
|
|
||||||
#ifdef DEBUG_UDP_RELAY
|
#ifdef DEBUG_UDP_RELAY
|
||||||
std::cerr << "UdpRelayReceiver::removeUdpPeer() removing UdpPeer" << std::endl;
|
std::cerr << "UdpRelayReceiver::removeUdpPeer() removing UdpPeer" << std::endl;
|
||||||
|
@ -1036,20 +1036,17 @@ UdpRelayProxy::UdpRelayProxy()
|
||||||
}
|
}
|
||||||
|
|
||||||
UdpRelayProxy::UdpRelayProxy(UdpRelayAddrSet *addrSet, int relayClass, uint32_t bandwidth)
|
UdpRelayProxy::UdpRelayProxy(UdpRelayAddrSet *addrSet, int relayClass, uint32_t bandwidth)
|
||||||
|
: mAddrs(*addrSet),
|
||||||
|
mRelayClass(relayClass),
|
||||||
|
mBandwidth(0),
|
||||||
|
mDataSize(0),
|
||||||
|
mLastBandwidthTS(0),
|
||||||
|
mLastTS(time(NULL)),
|
||||||
|
mStartTS(time(NULL)),
|
||||||
|
mBandwidthLimit(bandwidth)
|
||||||
{
|
{
|
||||||
mAddrs = *addrSet;
|
/* bandwidth fallback */
|
||||||
mRelayClass = relayClass;
|
if (bandwidth == 0)
|
||||||
|
|
||||||
mBandwidth = 0;
|
|
||||||
mDataSize = 0;
|
|
||||||
mLastBandwidthTS = 0;
|
|
||||||
mLastTS = time(NULL);
|
|
||||||
|
|
||||||
|
|
||||||
mStartTS = time(NULL);
|
|
||||||
mBandwidthLimit = bandwidth;
|
|
||||||
/* fallback */
|
|
||||||
if (mBandwidthLimit == 0)
|
|
||||||
{
|
{
|
||||||
switch(relayClass)
|
switch(relayClass)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue