mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 19:27:49 +02:00
added i2cp.inboundlimit and i2cp.outboundlimit
This commit is contained in:
parent
ea19d2296c
commit
1410fa5c21
2 changed files with 9 additions and 2 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "ClientContext.h"
|
||||
#include "Transports.h"
|
||||
#include "Signature.h"
|
||||
#include "Config.h"
|
||||
#include "I2CP.h"
|
||||
|
||||
namespace i2p
|
||||
|
@ -1003,8 +1004,12 @@ namespace client
|
|||
{
|
||||
uint8_t limits[64];
|
||||
memset (limits, 0, 64);
|
||||
htobe32buf (limits, i2p::context.GetBandwidthLimit ()); // inbound
|
||||
htobe32buf (limits + 4, i2p::context.GetBandwidthLimit ()); // outbound
|
||||
uint32_t limit; i2p::config::GetOption("i2cp.inboundlimit", limit);
|
||||
if (!limit) limit = i2p::context.GetBandwidthLimit ();
|
||||
htobe32buf (limits, limit); // inbound
|
||||
i2p::config::GetOption("i2cp.outboundlimit", limit);
|
||||
if (!limit) limit = i2p::context.GetBandwidthLimit ();
|
||||
htobe32buf (limits + 4, limit); // outbound
|
||||
SendI2CPMessage (I2CP_BANDWIDTH_LIMITS_MESSAGE, limits, 64);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue