1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-28 11:21:59 +03:00

resolved: indent less, by exiting earlier

This commit is contained in:
Lennart Poettering 2015-11-24 17:01:09 +01:00
parent f8dc7e343d
commit 84129d46cd
2 changed files with 14 additions and 12 deletions

View File

@ -136,11 +136,11 @@ void dns_scope_next_dns_server(DnsScope *s) {
void dns_scope_packet_received(DnsScope *s, usec_t rtt) { void dns_scope_packet_received(DnsScope *s, usec_t rtt) {
assert(s); assert(s);
if (rtt > s->max_rtt) { if (rtt <= s->max_rtt)
return;
s->max_rtt = rtt; s->max_rtt = rtt;
s->resend_timeout = MIN(MAX(MULTICAST_RESEND_TIMEOUT_MIN_USEC, s->max_rtt * 2), s->resend_timeout = MIN(MAX(MULTICAST_RESEND_TIMEOUT_MIN_USEC, s->max_rtt * 2), MULTICAST_RESEND_TIMEOUT_MAX_USEC);
MULTICAST_RESEND_TIMEOUT_MAX_USEC);
}
} }
void dns_scope_packet_lost(DnsScope *s, usec_t usec) { void dns_scope_packet_lost(DnsScope *s, usec_t usec) {

View File

@ -123,17 +123,19 @@ DnsServer* dns_server_unref(DnsServer *s) {
void dns_server_packet_received(DnsServer *s, usec_t rtt) { void dns_server_packet_received(DnsServer *s, usec_t rtt) {
assert(s); assert(s);
if (rtt > s->max_rtt) { if (rtt <= s->max_rtt)
return;
s->max_rtt = rtt; s->max_rtt = rtt;
s->resend_timeout = MIN(MAX(DNS_TIMEOUT_MIN_USEC, s->max_rtt * 2), s->resend_timeout = MIN(MAX(DNS_TIMEOUT_MIN_USEC, s->max_rtt * 2), DNS_TIMEOUT_MAX_USEC);
DNS_TIMEOUT_MAX_USEC);
}
} }
void dns_server_packet_lost(DnsServer *s, usec_t usec) { void dns_server_packet_lost(DnsServer *s, usec_t usec) {
assert(s); assert(s);
if (s->resend_timeout <= usec) if (s->resend_timeout > usec)
return;
s->resend_timeout = MIN(s->resend_timeout * 2, DNS_TIMEOUT_MAX_USEC); s->resend_timeout = MIN(s->resend_timeout * 2, DNS_TIMEOUT_MAX_USEC);
} }