mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
count bandwidth in kb/sec to avoid overflows on high bandwidth.
This commit is contained in:
+6
-4
@@ -86,8 +86,8 @@ static struct cfg_options available_options[] = {
|
||||
{ .name = "min-reauth-time", .type = OPTION_NUMERIC, .mandatory = 0 },
|
||||
{ .name = "max-same-clients", .type = OPTION_NUMERIC, .mandatory = 0 },
|
||||
|
||||
{ .name = "rx-per-sec", .type = OPTION_NUMERIC, .mandatory = 0 },
|
||||
{ .name = "tx-per-sec", .type = OPTION_NUMERIC, .mandatory = 0 },
|
||||
{ .name = "rx-data-per-sec", .type = OPTION_NUMERIC, .mandatory = 0 },
|
||||
{ .name = "tx-data-per-sec", .type = OPTION_NUMERIC, .mandatory = 0 },
|
||||
|
||||
{ .name = "run-as-user", .type = OPTION_STRING, .mandatory = 0 },
|
||||
{ .name = "run-as-group", .type = OPTION_STRING, .mandatory = 0 },
|
||||
@@ -319,8 +319,10 @@ unsigned prefix = 0;
|
||||
READ_NUMERIC("mtu", config->default_mtu);
|
||||
READ_NUMERIC("output-buffer", config->output_buffer);
|
||||
|
||||
READ_NUMERIC("rx-per-sec", config->rx_per_sec);
|
||||
READ_NUMERIC("tx-per-sec", config->tx_per_sec);
|
||||
READ_NUMERIC("rx-data-per-sec", config->rx_per_sec);
|
||||
READ_NUMERIC("tx-data-per-sec", config->tx_per_sec);
|
||||
config->rx_per_sec /= 1000; /* in kb */
|
||||
config->tx_per_sec /= 1000;
|
||||
|
||||
READ_NUMERIC("cookie-validity", config->cookie_validity);
|
||||
READ_NUMERIC("auth-timeout", config->auth_timeout);
|
||||
|
||||
Reference in New Issue
Block a user