From 9d14e3c281dd2e671cb3f8c4cd6b65e5b1051594 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Fri, 27 May 2016 13:49:54 +0000 Subject: [PATCH] - Fix #768: Unbound Service Sometimes Can Not Shutdown Completely, WER Report Shown Up. Close handle before closing WSA. git-svn-id: file:///svn/unbound/trunk@3731 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 2 ++ winrc/win_svc.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index 5e9009787..ee5f9abd1 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,8 @@ - Fix #770: Small subgroup attack on DH used in unix pipe on localhost if unbound control uses a unix local named pipe. - Document write permission to directory of trust anchor needed. + - Fix #768: Unbound Service Sometimes Can Not Shutdown + Completely, WER Report Shown Up. Close handle before closing WSA. 26 May 2016: Wouter - Updated patch from Charles Walker. diff --git a/winrc/win_svc.c b/winrc/win_svc.c index a0ddd3845..b9cd142d2 100644 --- a/winrc/win_svc.c +++ b/winrc/win_svc.c @@ -453,9 +453,9 @@ service_main(DWORD ATTR_UNUSED(argc), LPTSTR* ATTR_UNUSED(argv)) /* exit */ verbose(VERB_ALGO, "winservice - cleanup."); report_status(SERVICE_STOP_PENDING, NO_ERROR, 0); + if(service_stop_event) (void)WSACloseEvent(service_stop_event); service_deinit(daemon, cfg); free(service_cfgfile); - if(service_stop_event) (void)WSACloseEvent(service_stop_event); verbose(VERB_QUERY, "winservice - full stop"); report_status(SERVICE_STOPPED, NO_ERROR, 0); }