mirror of
https://github.com/yarrick/iodine.git
synced 2025-04-10 04:21:01 +00:00
store the delay variance factor in a double
This commit is contained in:
parent
d26ddb9a07
commit
d10bea1607
3 changed files with 5 additions and 5 deletions
|
@ -209,7 +209,7 @@ update_server_timeout(int handshake)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update up/down window timeouts to something reasonable */
|
/* update up/down window timeouts to something reasonable */
|
||||||
this.downstream_timeout_ms = rtt_ms * this.downstream_delay_variance / 100;
|
this.downstream_timeout_ms = rtt_ms * this.downstream_delay_variance;
|
||||||
this.outbuf->timeout = ms_to_timeval(this.downstream_timeout_ms);
|
this.outbuf->timeout = ms_to_timeval(this.downstream_timeout_ms);
|
||||||
|
|
||||||
if (handshake) {
|
if (handshake) {
|
||||||
|
|
|
@ -88,7 +88,7 @@ struct client_instance {
|
||||||
/* Server response timeout in ms and downstream window timeout */
|
/* Server response timeout in ms and downstream window timeout */
|
||||||
time_t server_timeout_ms;
|
time_t server_timeout_ms;
|
||||||
time_t downstream_timeout_ms;
|
time_t downstream_timeout_ms;
|
||||||
time_t downstream_delay_variance;
|
double downstream_delay_variance;
|
||||||
int autodetect_server_timeout;
|
int autodetect_server_timeout;
|
||||||
|
|
||||||
/* Cumulative Round-Trip-Time in ms */
|
/* Cumulative Round-Trip-Time in ms */
|
||||||
|
|
|
@ -82,7 +82,7 @@ struct client_instance this;
|
||||||
.next_downstream_ack = -1, \
|
.next_downstream_ack = -1, \
|
||||||
.num_immediate = 1, \
|
.num_immediate = 1, \
|
||||||
.rtt_total_ms = 200, \
|
.rtt_total_ms = 200, \
|
||||||
.downstream_delay_variance = 200, \
|
.downstream_delay_variance = 2.0, \
|
||||||
.remote_forward_addr = {.ss_family = AF_UNSPEC}
|
.remote_forward_addr = {.ss_family = AF_UNSPEC}
|
||||||
|
|
||||||
static struct client_instance preset_default = {
|
static struct client_instance preset_default = {
|
||||||
|
@ -576,7 +576,7 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'J':
|
case 'J':
|
||||||
this.downstream_delay_variance = strtod(optarg, NULL) * 100;
|
this.downstream_delay_variance = strtod(optarg, NULL);
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
this.send_interval_ms = atoi(optarg);
|
this.send_interval_ms = atoi(optarg);
|
||||||
|
@ -696,7 +696,7 @@ main(int argc, char **argv)
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.downstream_delay_variance < 10) {
|
if (this.downstream_delay_variance < 0.1) {
|
||||||
warnx("Delay variance factor must be more than 0.1 to prevent excessive retransmits.");
|
warnx("Delay variance factor must be more than 0.1 to prevent excessive retransmits.");
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue