X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Futil.cpp;h=df9984c4961b55a921257d080eb8c758aef3c620;hb=1615e9726fe4457ef6efea73f0d1bed70b18342d;hp=461534741b47fad92cab20a31dff462d5dd32cf8;hpb=c93d8c8db5ae24e01775060677f8e8e9c2afff34;p=metaproxy-moved-to-github.git diff --git a/src/util.cpp b/src/util.cpp index 4615347..df9984c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,4 +1,4 @@ -/* $Id: util.cpp,v 1.20 2006-09-29 08:42:47 marc Exp $ +/* $Id: util.cpp,v 1.22 2006-10-03 07:57:40 marc Exp $ Copyright (c) 2005-2006, Index Data. See the LICENSE file for details @@ -34,6 +34,65 @@ std::string mp_util::http_header_value(const Z_HTTP_Header* header, return std::string(); } +std::string mp_util::http_headers_debug(const Z_HTTP_Request &http_req) +{ + std::string message("\n
\n\n";
+ message += "Method: " + std::string(http_req.method) + "
\n";
+ message += "Version: " + std::string(http_req.version) + "
\n";
+ message += "Path: " + std::string(http_req.path) + "
\n";
+
+ message += "Content-Type:"
+ + mp_util::http_header_value(http_req.headers, "Content-Type")
+ + "
\n";
+ message += "Content-Length:"
+ + mp_util::http_header_value(http_req.headers, "Content-Length")
+ + "
\n";
+ message += "
\n";
+ Z_HTTP_Header* header = http_req.headers;
+ while (header){
+ message += "Header: "
+ + std::string(header->name) + ": "
+ + std::string(header->value) + "
\n";
+ header = header->next;
+ }
+ message += "