aboutsummaryrefslogtreecommitdiff
path: root/web/apache/request.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-28 17:56:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-11 17:46:11 +0200
commit1ce84922e3008cad6cf1b9056b705f2642bd3772 (patch)
tree0dde62654e56c8e94ebf0cef83181ea9ddc99faf /web/apache/request.cxx
parent4993f11bf464c9aee0e3fd5965f4a8258cbe8b30 (diff)
WEB pages re-styling
Diffstat (limited to 'web/apache/request.cxx')
-rw-r--r--web/apache/request.cxx32
1 files changed, 14 insertions, 18 deletions
diff --git a/web/apache/request.cxx b/web/apache/request.cxx
index 497d2d6..9887104 100644
--- a/web/apache/request.cxx
+++ b/web/apache/request.cxx
@@ -99,33 +99,31 @@ namespace web
{
if (::strcasecmp (h->key, "Cookie") == 0)
{
- for (const char* n (h->val); n != 0; )
+ for (const char* n (h->val); n != nullptr; )
{
const char* v (strchr (n, '='));
const char* e (strchr (n, ';'));
- if (e && e < v)
- v = 0;
+ if (e != nullptr && e < v)
+ v = nullptr;
- string name (v
+ string name (v != nullptr
? mime_url_decode (n, v, true)
: (e
? mime_url_decode (n, e, true)
: mime_url_decode (n, n + strlen (n), true)));
- string value;
+ optional<string> value;
if (v++)
- {
value = e
? mime_url_decode (v, e, true)
: mime_url_decode (v, v + strlen (v), true);
- }
- if (!name.empty () || !value.empty ())
+ if (!name.empty () || value)
cookies_->emplace_back (move (name), move (value));
- n = e ? e + 1 : 0;
+ n = e ? e + 1 : nullptr;
}
}
}
@@ -252,33 +250,31 @@ namespace web
void request::
parse_parameters (const char* args)
{
- for (auto n (args); n != 0; )
+ for (auto n (args); n != nullptr; )
{
const char* v (strchr (n, '='));
const char* e (strchr (n, '&'));
- if (e && e < v)
- v = 0;
+ if (e != nullptr && e < v)
+ v = nullptr;
- string name (v
+ string name (v != nullptr
? mime_url_decode (n, v) :
(e
? mime_url_decode (n, e)
: mime_url_decode (n, n + strlen (n))));
- string value;
+ optional<string> value;
if (v++)
- {
value = e
? mime_url_decode (v, e)
: mime_url_decode (v, v + strlen (v));
- }
- if (!name.empty () || !value.empty ())
+ if (!name.empty () || value)
parameters_->emplace_back (move (name), move (value));
- n = e ? e + 1 : 0;
+ n = e ? e + 1 : nullptr;
}
}
}