From 3a30d67411842db9a0c5cc5e49ab9fb0aec27975 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 16 Sep 2014 05:31:28 +0000 Subject: [PATCH] fixed missing urs deactivation upon initialization failure --- qse/cmd/http/httpd.c | 2 +- qse/lib/http/httpd.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qse/cmd/http/httpd.c b/qse/cmd/http/httpd.c index dc9c739d..9ce91cb9 100644 --- a/qse/cmd/http/httpd.c +++ b/qse/cmd/http/httpd.c @@ -2194,7 +2194,7 @@ static void impede_httpd (qse_httpd_t* httpd) httpd_xtn = qse_httpd_getxtnstd (httpd); if (open_config_file (httpd) >= 0) - { + { qse_httpd_server_t* server; server = qse_httpd_getfirstserver (httpd); diff --git a/qse/lib/http/httpd.c b/qse/lib/http/httpd.c index fc699b1e..b412e26e 100644 --- a/qse/lib/http/httpd.c +++ b/qse/lib/http/httpd.c @@ -1690,12 +1690,14 @@ int qse_httpd_loop (qse_httpd_t* httpd) if (activate_servers (httpd) <= -1) { if (httpd->dnsactive) deactivate_dns (httpd); + if (httpd->ursactive) deactivate_urs (httpd); httpd->opt.scb.mux.close (httpd, httpd->mux); return -1; } if (httpd->server.nactive <= 0) { if (httpd->dnsactive) deactivate_dns (httpd); + if (httpd->ursactive) deactivate_urs (httpd); httpd->opt.scb.mux.close (httpd, httpd->mux); httpd->errnum = QSE_HTTPD_ENOSVR;