From 59e9504ee48c948d082fcce572e2a36e9d945ff2 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 13 May 2016 18:09:38 +0200 Subject: [PATCH] dnsdist: Only log YaHTTP's parser exceptions in verbose mode Log the remote client address in any case. --- pdns/dnsdist-web.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 0699f14b07..f0cb43be82 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -400,13 +400,18 @@ static void connectionThread(int sock, ComboAddress remote, string password, str fclose(fp); fp=0; } + catch(const YaHTTP::ParseError& e) { + vinfolog("Webserver thread died with parse error exception while processing a request from %s: %s", remote.toStringWithPort(), e.what()); + if(fp) + fclose(fp); + } catch(const std::exception& e) { - errlog("Webserver thread died with exception: %s", e.what()); + errlog("Webserver thread died with exception while processing a request from %s: %s", remote.toStringWithPort(), e.what()); if(fp) fclose(fp); } catch(...) { - errlog("Webserver thread died with exception"); + errlog("Webserver thread died with exception while processing a request from %s", remote.toStringWithPort()); if(fp) fclose(fp); } -- 2.47.2