]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/message.cpp
Add a dynamic receiver class for more flexible packet handling
[libs/net.git] / source / http / message.cpp
index 2ae0ff80a641e3f133f051c37fe66569e6a93944..a6ab4653de9dec58c7c186ea5ecd5c6138545102 100644 (file)
@@ -1,20 +1,14 @@
+#include "message.h"
 #include <cstdlib>
 #include <msp/core/maputils.h>
 #include <msp/strings/format.h>
 #include <msp/strings/utils.h>
-#include "message.h"
 
 using namespace std;
 
 namespace Msp {
 namespace Http {
 
-Message::Message():
-       http_version(0x11),
-       chunk_length(0),
-       complete(false)
-{ }
-
 void Message::set_header(const string &hdr, const string &val)
 {
        headers[normalize_header_name(hdr)] = val;
@@ -48,7 +42,7 @@ unsigned Message::parse_content(const string &d)
        if(complete)
                return 0;
 
-       HeaderMap::const_iterator i = headers.find("Content-Length");
+       auto i = headers.find("Content-Length");
        if(i!=headers.end())
        {
                string::size_type needed = lexical_cast<string::size_type>(i->second)-content.size();