performance improvements to DateTimeParser and HTTP server

This commit is contained in:
Guenter Obiltschnig
2009-02-01 20:27:19 +00:00
parent 75ecce9cc4
commit 37dc590bdf
12 changed files with 78 additions and 31 deletions

View File

@@ -136,6 +136,7 @@ const std::string& HTTPRequest::getHost() const
void HTTPRequest::setCookies(const NameValueCollection& cookies)
{
std::string cookie;
cookie.reserve(64);
for (NameValueCollection::ConstIterator it = cookies.begin(); it != cookies.end(); ++it)
{
if (it != cookies.begin())
@@ -207,6 +208,9 @@ void HTTPRequest::read(std::istream& istr)
std::string method;
std::string uri;
std::string version;
method.reserve(16);
uri.reserve(64);
version.reserve(16);
int ch = istr.get();
if (ch == eof) throw NoMessageException();
while (std::isspace(ch)) ch = istr.get();