Notify all requests on name lookup failures.
Since there's no active request during a name lookup failure, explicitly fail all sent and queued requests, so the Request subclasses can take regular failure action.
This commit is contained in:
parent
ec82a0154b
commit
b74d2ae9fa
@ -88,7 +88,18 @@ public:
|
|||||||
virtual void handleError(int error)
|
virtual void handleError(int error)
|
||||||
{
|
{
|
||||||
if (error == ENOENT) {
|
if (error == ENOENT) {
|
||||||
// name lookup failure, abandon all requests on this connection
|
// name lookup failure
|
||||||
|
// we won't have an active request yet, so the logic below won't
|
||||||
|
// fire to actually call setFailure. Let's fail all of the requests
|
||||||
|
BOOST_FOREACH(Request_ptr req, sentRequests) {
|
||||||
|
req->setFailure(error, "hostname lookup failure");
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_FOREACH(Request_ptr req, queuedRequests) {
|
||||||
|
req->setFailure(error, "hostname lookup failure");
|
||||||
|
}
|
||||||
|
|
||||||
|
// name lookup failure, abandon all requests on this connection
|
||||||
sentRequests.clear();
|
sentRequests.clear();
|
||||||
queuedRequests.clear();
|
queuedRequests.clear();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user