mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-25 11:05:15 +00:00
Always print window sizes on startup
This commit is contained in:
parent
8232979a6e
commit
122e42a5f7
30
src/client.c
30
src/client.c
@ -170,7 +170,7 @@ update_server_timeout(int handshake)
|
|||||||
static size_t num_rtt_timeouts = 0;
|
static size_t num_rtt_timeouts = 0;
|
||||||
|
|
||||||
/* Get average RTT in ms */
|
/* Get average RTT in ms */
|
||||||
rtt_ms = this.rtt_total_ms / this.num_immediate;
|
rtt_ms = (this.num_immediate == 0) ? 1 : this.rtt_total_ms / this.num_immediate;
|
||||||
if (rtt_ms >= this.max_timeout_ms && this.num_immediate > 5) {
|
if (rtt_ms >= this.max_timeout_ms && this.num_immediate > 5) {
|
||||||
num_rtt_timeouts++;
|
num_rtt_timeouts++;
|
||||||
if (num_rtt_timeouts < 3) {
|
if (num_rtt_timeouts < 3) {
|
||||||
@ -308,7 +308,7 @@ got_response(int id, int immediate, int fail)
|
|||||||
this.rtt_total_ms += rtt_ms;
|
this.rtt_total_ms += rtt_ms;
|
||||||
this.num_immediate++;
|
this.num_immediate++;
|
||||||
|
|
||||||
if (this.autodetect_server_timeout)
|
if (this.autodetect_server_timeout && this.lazymode)
|
||||||
update_server_timeout(0);
|
update_server_timeout(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2409,12 +2409,14 @@ handshake_set_timeout()
|
|||||||
char in[4096];
|
char in[4096];
|
||||||
int read, id;
|
int read, id;
|
||||||
|
|
||||||
if (this.autodetect_server_timeout && this.lazymode) {
|
fprintf(stderr, "Setting window sizes to %lu frags upstream, %lu frags downstream...\n",
|
||||||
fprintf(stderr, "Calculating round-trip time for optimum server timeout...");
|
this.windowsize_up, this.windowsize_down);
|
||||||
} else {
|
|
||||||
fprintf(stderr, "Setting window sizes to %lu frags upstream, %lu frags downstream...",
|
fprintf(stderr, "Calculating round-trip time...");
|
||||||
this.windowsize_up, this.windowsize_down);
|
|
||||||
}
|
/* Reset RTT stats */
|
||||||
|
this.num_immediate = 0;
|
||||||
|
this.rtt_total_ms = 0;
|
||||||
|
|
||||||
for (int i = 0; this.running && i < 5; i++) {
|
for (int i = 0; this.running && i < 5; i++) {
|
||||||
|
|
||||||
@ -2429,21 +2431,15 @@ handshake_set_timeout()
|
|||||||
if (strncmp("BADIP", in, 5) == 0) {
|
if (strncmp("BADIP", in, 5) == 0) {
|
||||||
fprintf(stderr, "Server rejected sender IP address.\n");
|
fprintf(stderr, "Server rejected sender IP address.\n");
|
||||||
}
|
}
|
||||||
if (this.autodetect_server_timeout)
|
continue;
|
||||||
continue;
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!this.running)
|
if (!this.running)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.autodetect_server_timeout)
|
fprintf(stderr, "\nDetermined round-trip time of %ld ms, using server timeout of %ld ms.\n",
|
||||||
fprintf(stderr, "\nDetermined round-trip time of %ld ms, server timeout of %ld ms.\n",
|
this.rtt_total_ms / this.num_immediate, this.server_timeout_ms);
|
||||||
this.rtt_total_ms / this.num_immediate, this.server_timeout_ms);
|
|
||||||
else
|
|
||||||
fprintf(stderr, " done\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user