From 533cadf520b44a8b6e050f21beaf98e1a95f24ec Mon Sep 17 00:00:00 2001 From: root Date: Mon, 6 Oct 2008 17:39:33 +0200 Subject: [PATCH] If something goes bad with loading, but the file actually exist, give a internal error. --- handler_virt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/handler_virt.c b/handler_virt.c index 2a61bdc..200770f 100644 --- a/handler_virt.c +++ b/handler_virt.c @@ -1586,9 +1586,15 @@ virt_build_page (cherokee_handler_virt_t *hdl) } else { /* We should also look on disk for defined stuff */ cherokee_buffer_t xmlDesc = CHEROKEE_BUF_INIT; - if (load_xml(hdl, &xmlDesc) == ret_ok && (virDom = virDomainDefineXML(virConn, xmlDesc.buf)) != NULL) { - /* The domain existed and is loaded! */ - ret = ret_ok; + if (load_xml(hdl, &xmlDesc) == ret_ok) + if ((virDom = virDomainDefineXML(virConn, xmlDesc.buf)) != NULL) { + /* The domain existed and is loaded! */ + ret = ret_ok; + } else { + hdl->action = nothing; + conn->error_code = http_internal_error; + ret = ret_error; + } } else { /* Otherwise we don't have anything to do and we should * return an error */ -- 2.11.4.GIT