Don't dereference the end iterator when async_connect exhausts the range.

This commit is contained in:
Christopher Kohlhoff 2015-05-30 09:15:56 +10:00
parent 34412f72dd
commit 5b89400ac3

View File

@ -324,7 +324,8 @@ namespace detail
}
handler_(static_cast<const asio::error_code&>(ec),
static_cast<const typename Protocol::endpoint&>(*iter));
static_cast<const typename Protocol::endpoint&>(
ec || iter == end ? typename Protocol::endpoint() : *iter));
}
}