X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fresponse.cpp;h=a5f95825c1c65fc8170552e4046083fea12db828;hb=1c965907682f4714db7b952915cf5b6bf9b7f4c1;hp=4da67422fa221735ea234f64d7430e0d2e857d88;hpb=b06cf07513fdd85e249398ebfce500fbf3dfb6a7;p=libs%2Fnet.git diff --git a/source/response.cpp b/source/response.cpp index 4da6742..a5f9582 100644 --- a/source/response.cpp +++ b/source/response.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmsphttp -Copyright © 2008 Mikkosoft Productions, Mikko Rasa -Distributed under the LGPL -*/ - #include #include #include "response.h" @@ -20,8 +13,8 @@ Response::Response(Status s): string Response::str() const { - string result=format("%s %d %s\r\n", version_str(http_version), static_cast(status), status); - result+=str_common(); + string result = format("%s %d %s\r\n", version_str(http_version), static_cast(status), status); + result += str_common(); return result; } @@ -30,15 +23,15 @@ Response Response::parse(const string &str) { Response result; - unsigned lf=str.find('\n'); - vector parts=split(str.substr(0, lf), ' ', 2); + unsigned lf = str.find('\n'); + vector parts = split(str.substr(0, lf), ' ', 2); if(parts.size()<2) throw InvalidParameterValue("Invalid response"); - result.http_version=parse_version(parts[0]); - result.status=static_cast(lexical_cast(parts[1])); + result.http_version = parse_version(parts[0]); + result.status = static_cast(lexical_cast(parts[1])); - lf+=result.parse_headers(str.substr(lf+1)); + lf += result.parse_headers(str.substr(lf+1)); result.parse_content(str.substr(lf+1));