summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2012-03-26 09:36:26 -0700
committerPixel <pixel@nobis-crew.org>2012-03-26 09:36:26 -0700
commit6e3130bab3ded0ecc802b81b423e702f65b147c5 (patch)
tree6fcf97240188a495d9f98cd7a06eb44903df65a0
parentee2d62c0f4109e3160561f31072807aaa847baf8 (diff)
Further code simplification.
-rw-r--r--src/HttpServer.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/HttpServer.cc b/src/HttpServer.cc
index f13cf1e..c234096 100644
--- a/src/HttpServer.cc
+++ b/src/HttpServer.cc
@@ -193,8 +193,8 @@ void Balau::HttpWorker::sendError(int error, const char * msg, const char * deta
if (details)
ctx["details"] = details;
if (m_socket->isClosed()) return;
- for (auto i = trace.begin(); i != trace.end(); i++)
- ctx["trace"][(ssize_t) 0]["line"] = *i;
+ for (String & str : trace)
+ ctx["trace"][(ssize_t) 0]["line"] = str;
if (closeConnection) {
String headers;
headers.set(
@@ -203,8 +203,8 @@ void Balau::HttpWorker::sendError(int error, const char * msg, const char * deta
"Connection: close\r\n"
"Server: %s\r\n",
error, errorMsg, m_server->getServerName().to_charp());
- for (auto i = extraHeaders.begin(); i != extraHeaders.end(); i++)
- headers += *i + "\r\n";
+ for (String & str : extraHeaders)
+ headers += str + "\r\n";
headers += "\r\n";
m_socket->forceWrite(headers);
if (m_socket->isClosed()) return;
@@ -221,8 +221,8 @@ void Balau::HttpWorker::sendError(int error, const char * msg, const char * deta
"Server: %s\r\n"
"Content-Length: %lli\r\n",
error, errorMsg, m_server->getServerName().to_charp(), length);
- for (auto i = extraHeaders.begin(); i != extraHeaders.end(); i++)
- headers += *i + "\r\n";
+ for (String & str : extraHeaders)
+ headers += str + "\r\n";
headers += "\r\n";
m_socket->forceWrite(headers);
if (m_socket->isClosed()) return;
@@ -636,8 +636,8 @@ Balau::HttpServer::ActionFound Balau::HttpServer::findAction(const char * uri, c
ActionFound r;
- for (auto i = m_actions.begin(); i != m_actions.end(); i++) {
- r.action = *i;
+ for (Action * action : m_actions) {
+ r.action = action;
r.matches = r.action->matches(uri, host);
if (!r.matches.uri.empty())
break;