diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-15 19:34:34 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-15 19:34:34 (GMT) |
commit | 940de61e5b6d8651f6ea8b1626c92f5d80cb723c (patch) | |
tree | 5496b8b5274d9333794f90acdc31b39001707be9 /src/uscxml/server | |
parent | 9149b28c87c7a037dfd244aa5d4c1409b6593dca (diff) | |
download | uscxml-940de61e5b6d8651f6ea8b1626c92f5d80cb723c.zip uscxml-940de61e5b6d8651f6ea8b1626c92f5d80cb723c.tar.gz uscxml-940de61e5b6d8651f6ea8b1626c92f5d80cb723c.tar.bz2 |
Polished xhtml invoker
Diffstat (limited to 'src/uscxml/server')
-rw-r--r-- | src/uscxml/server/HTTPServer.cpp | 5 | ||||
-rw-r--r-- | src/uscxml/server/HTTPServer.h | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/uscxml/server/HTTPServer.cpp b/src/uscxml/server/HTTPServer.cpp index bbcbd37..48d2f96 100644 --- a/src/uscxml/server/HTTPServer.cpp +++ b/src/uscxml/server/HTTPServer.cpp @@ -408,7 +408,10 @@ void HTTPServer::httpRecvReqCallback(struct evhttp_request *req, void *callbackD } request.data.compound["content"].atom.clear(); } else if (iequals(contentType.substr(0, 16), "application/json")) { - request.data.compound["content"] = Data::fromJSON(request.data.compound["content"].atom); + Data json = Data::fromJSON(request.data.compound["content"].atom); + if (!json.empty()) { + request.data.compound["content"] = json; + } } else if (iequals(contentType.substr(0, 15), "application/xml")) { NameSpacingParser parser = NameSpacingParser::fromXML(request.data.compound["content"].atom); if (parser.errorsReported()) { diff --git a/src/uscxml/server/HTTPServer.h b/src/uscxml/server/HTTPServer.h index b1816bc..dc9af53 100644 --- a/src/uscxml/server/HTTPServer.h +++ b/src/uscxml/server/HTTPServer.h @@ -71,7 +71,14 @@ public: class Reply { public: + Reply() : status(200), type("get"), evhttpReq(NULL) {} Reply(Request req) : status(200), type(req.data.compound["type"].atom), evhttpReq(req.evhttpReq) {} + + void setRequest(Request req) { + type = req.data.compound["type"].atom; + evhttpReq = req.evhttpReq; + } + int status; std::string type; std::map<std::string, std::string> headers; |