diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-10-26 23:47:24 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-10-26 23:47:24 (GMT) |
commit | 45ba8b93098f4f64a2dbc1e0a4c15c5ddb1d6559 (patch) | |
tree | c82a47a2dfb417bb5f0305254f45fa84d69e0a57 /src/uscxml/server | |
parent | cb4356f33044fd42958cdede5dfe93ef4516173a (diff) | |
download | uscxml-45ba8b93098f4f64a2dbc1e0a4c15c5ddb1d6559.zip uscxml-45ba8b93098f4f64a2dbc1e0a4c15c5ddb1d6559.tar.gz uscxml-45ba8b93098f4f64a2dbc1e0a4c15c5ddb1d6559.tar.bz2 |
Performance: replaced boost::iequals for strings by inline function
Diffstat (limited to 'src/uscxml/server')
-rw-r--r-- | src/uscxml/server/HTTPServer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/uscxml/server/HTTPServer.cpp b/src/uscxml/server/HTTPServer.cpp index ef7fb83..4598615 100644 --- a/src/uscxml/server/HTTPServer.cpp +++ b/src/uscxml/server/HTTPServer.cpp @@ -364,7 +364,7 @@ void HTTPServer::httpRecvReqCallback(struct evhttp_request *req, void *callbackD request.data.compound["header"].compound.find("Content-Type") != request.data.compound["header"].compound.end()) { std::string contentType = request.data.compound["header"].compound["Content-Type"].atom; if (false) { - } else if (boost::iequals(contentType, "application/x-www-form-urlencoded")) { + } else if (iequals(contentType, "application/x-www-form-urlencoded")) { // this is a form submit std::stringstream ss(request.data.compound["content"].atom); std::string item; @@ -387,7 +387,7 @@ void HTTPServer::httpRecvReqCallback(struct evhttp_request *req, void *callbackD key.clear(); } request.data.compound["content"].atom.clear(); - } else if (boost::iequals(contentType, "application/json")) { + } else if (iequals(contentType, "application/json")) { request.data.compound["content"] = Data::fromJSON(request.data.compound["content"].atom); } } @@ -415,8 +415,8 @@ void HTTPServer::processByMatchingServlet(const Request& request) { while(servletIter != _servlets.end()) { // is the servlet path a prefix of the actual path? std::string servletPath = "/" + servletIter->first; - if (boost::iequals(actualPath.substr(0, servletPath.length()), servletPath) && // actual path is a prefix - boost::iequals(actualPath.substr(servletPath.length(), 1), "/")) { // and next character is a '/' + if (iequals(actualPath.substr(0, servletPath.length()), servletPath) && // actual path is a prefix + iequals(actualPath.substr(servletPath.length(), 1), "/")) { // and next character is a '/' matches.insert(std::make_pair(servletPath, servletIter->second)); } servletIter++; @@ -462,7 +462,7 @@ void HTTPServer::replyCallback(evutil_socket_t fd, short what, void *arg) { struct evbuffer *evb = NULL; - if (!boost::iequals(reply->type, "HEAD") && reply->content.size() > 0) { + if (!iequals(reply->type, "HEAD") && reply->content.size() > 0) { evb = evbuffer_new(); evbuffer_add(evb, reply->content.data(), reply->content.size()); } |