From: Naoki Kambe Date: Thu, 5 Apr 2012 04:10:04 +0000 (+0900) Subject: [1852] When opening a HTTP socket is unexpectedly failed due to a socket error e... X-Git-Tag: trac2351_base~226^2~116^2~11^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed1f3349ee00294fbeb42760a53a2694f9dc02eb;p=thirdparty%2Fkea.git [1852] When opening a HTTP socket is unexpectedly failed due to a socket error e.g. Address already in use, it explicitly closes the CC Session already opened before it shuts down. --- diff --git a/src/bin/stats/stats_httpd.py.in b/src/bin/stats/stats_httpd.py.in index c9bd0f5c88..7e4da96d0c 100644 --- a/src/bin/stats/stats_httpd.py.in +++ b/src/bin/stats/stats_httpd.py.in @@ -189,7 +189,12 @@ class StatsHttpd: self.load_config() self.http_addrs = [] self.mccs.start() - self.open_httpd() + try: + self.open_httpd() + except HttpServerError: + # if some exception, e.g. address in use, is raised, then it closes mccs and httpd + self.close_mccs() + raise def open_mccs(self): """Opens a ModuleCCSession object"""