}
return 0;
}
+catch(const std::exception& e)
+{
+ errlog("UDP responder thread died because of exception: %s", e.what());
+ return 0;
+}
+catch(const PDNSException& e)
+{
+ errlog("UDP responder thread died because of PowerDNS exception: %s", e.reason);
+ return 0;
+}
+catch(...)
+{
+ errlog("UDP responder thread died because of an exception: %s", "unknown");
+ return 0;
+}
- DownstreamState::DownstreamState(const ComboAddress& remote_, const ComboAddress& sourceAddr_, unsigned int sourceItf_): remote(remote_), sourceAddr(sourceAddr_), sourceItf(sourceItf_)
+ void DownstreamState::reconnect()
{
+ connected = false;
+ if (fd != -1) {
+ /* shutdown() is needed to wake up recv() in the responderThread */
+ shutdown(fd, SHUT_RDWR);
+ close(fd);
+ fd = -1;
+ }
if (!IsAnyAddress(remote)) {
fd = SSocket(remote.sin4.sin_family, SOCK_DGRAM, 0);
if (!IsAnyAddress(sourceAddr)) {