diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-05-23 10:50:59 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-05-23 10:50:59 (GMT) |
commit | 9f3dfcd9982cff90cf0466413d17fc1061c43f00 (patch) | |
tree | e29d0f70ecdfb742e3bbbc522e87281c8bbd58e7 /src/uscxml/plugins/invoker/xhtml | |
parent | 216e8efb0f1aff9afd3881ab89b49e017e255228 (diff) | |
download | uscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.zip uscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.tar.gz uscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.tar.bz2 |
Fixed the 100% CPU utilization bug and replaced the bool() cast operator for data by empty()
Diffstat (limited to 'src/uscxml/plugins/invoker/xhtml')
-rw-r--r-- | src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp index e607cf4..0418f8a 100644 --- a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp +++ b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp @@ -81,7 +81,7 @@ bool XHTMLInvoker::httpRecvRequest(const HTTPServer::Request& req) { } else { // a POST request Event ev(req); - if (ev.data["header"]["X-SCXML-Name"]) { + if (ev.data["header"].hasKey("X-SCXML-Name")) { ev.name = ev.data["header"]["X-SCXML-Name"].atom; } else { ev.name = req.data.at("type").atom; @@ -101,7 +101,7 @@ bool XHTMLInvoker::httpRecvRequest(const HTTPServer::Request& req) { } // initial request for a document - if (!req.data["query"] && // no query parameters + if (!req.data.hasKey("query") && // no query parameters iequals(req.data.at("type").atom, "get") && // request type is GET req.content.length() == 0) { // no content @@ -113,7 +113,7 @@ bool XHTMLInvoker::httpRecvRequest(const HTTPServer::Request& req) { // ss << _invokeReq.getFirstDOMElement(); ss << _invokeReq.dom; content = ss.str(); - } else if(_invokeReq.data) { + } else if(!_invokeReq.data.empty()) { ss << _invokeReq.data; content = ss.str(); } else if (_invokeReq.content.length() > 0) { @@ -163,7 +163,7 @@ void XHTMLInvoker::send(const SendRequest& req) { SendRequest reqCopy(req); _interpreter->getDataModel().replaceExpressions(reqCopy.content); Data json = Data::fromJSON(reqCopy.content); - if (json) { + if (!json.empty()) { reqCopy.data = json; } @@ -195,7 +195,7 @@ void XHTMLInvoker::reply(const SendRequest& req, const HTTPServer::Request& long ss << req.dom; reply.content = ss.str(); reply.headers["Content-Type"] = "application/xml"; - } else if (req.data) { + } else if (!req.data.empty()) { reply.content = Data::toJSON(req.data); reply.headers["Content-Type"] = "application/json"; } else if (req.content.length() > 0) { |