forked from mirrors/gecko-dev
Bug 1626029 - Don't attempt to resend mDNS packets on EPERM; r=mjf
We currently retry sending queries on all failures to write to the socket on the assumption that write errors represent transient errors. With this change, we treat EPERM has a permanent error and drop queries if we see it. This is not a problem when sending answers, as we don't retry in case of errors there, on the assumption that the other side will retry their query in the future. We do have code to limit the number of times we attempt an mDNS query, but we didn't hit it in this case, because it only counts sends that are successful. Differential Revision: https://phabricator.services.mozilla.com/D73492
This commit is contained in:
parent
0eedff8d8e
commit
d0b4c7e527
1 changed files with 8 additions and 2 deletions
|
|
@ -164,8 +164,14 @@ fn handle_queries(
|
|||
}
|
||||
Err(err) => {
|
||||
warn!("Sending mDNS query failed: {}", err);
|
||||
for query in queries {
|
||||
unsent_queries.push_back(query);
|
||||
if err.kind() != io::ErrorKind::PermissionDenied {
|
||||
for query in queries {
|
||||
unsent_queries.push_back(query);
|
||||
}
|
||||
} else {
|
||||
for query in queries {
|
||||
hostname_timedout(&query.callback, &query.hostname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue