Make the retransmits code compile again on systems without retransmits.

This commit is contained in:
Jef Poskanzer 2012-12-03 16:00:14 -08:00
parent 46baab59e8
commit d7ebadafa4
2 changed files with 11 additions and 7 deletions

View File

@ -29,7 +29,9 @@ struct iperf_interval_results
struct tcp_info tcpInfo; /* getsockopt(TCP_INFO) for Linux and FreeBSD */
int this_retrans;
#else
char *tcpInfo; /* just a placeholder */
/* Just placeholders, never accessed. */
char *tcpInfo;
int this_retrans;
#endif
TAILQ_ENTRY(iperf_interval_results) irlistentries;
void *custom_data;

View File

@ -1273,13 +1273,15 @@ iperf_stats_callback(struct iperf_test * test)
temp.interval_duration = timeval_diff(&temp.interval_start_time, &temp.interval_end_time);
//temp.interval_duration = timeval_diff(&temp.interval_start_time, &temp.interval_end_time);
if (test->protocol->id == Ptcp && has_tcpinfo()) {
irp = TAILQ_LAST(&rp->interval_results, irlisthead);
if (irp == NULL)
prev_total_retransmits = 0;
else
prev_total_retransmits = get_tcpinfo_total_retransmits(irp);
save_tcpinfo(sp, &temp);
temp.this_retrans = get_tcpinfo_total_retransmits(&temp) - prev_total_retransmits;
if (has_tcpinfo_retransmits()) {
irp = TAILQ_LAST(&rp->interval_results, irlisthead);
if (irp == NULL)
prev_total_retransmits = 0;
else
prev_total_retransmits = get_tcpinfo_total_retransmits(irp);
temp.this_retrans = get_tcpinfo_total_retransmits(&temp) - prev_total_retransmits;
}
}
add_to_interval_list(rp, &temp);
rp->bytes_sent_this_interval = rp->bytes_received_this_interval = 0;