diff --git a/calexium_lib/web/CXM_common.anubis b/calexium_lib/web/CXM_common.anubis index 26550cd..40e4846 100644 --- a/calexium_lib/web/CXM_common.anubis +++ b/calexium_lib/web/CXM_common.anubis @@ -197,17 +197,3 @@ public define List(String) } . -public define String - dump_web_arg_values - ( - List(Web_arg) l, - ) = - if l is - { - [ ] then "\n", - [h . t] then if h is - { - web_arg(n,v) then "\n["+n+"] = '"+v+"'" + dump_web_arg_values(t), - upload(n,v,tfn) then "\n["+n+"] = '"+v+"'" + dump_web_arg_values(t) - } - }. diff --git a/calexium_lib/web/CXM_web_dump.anubis b/calexium_lib/web/CXM_web_dump.anubis new file mode 100644 index 0000000..415d035 --- /dev/null +++ b/calexium_lib/web/CXM_web_dump.anubis @@ -0,0 +1,69 @@ +/* + * Created by PyramIDE. + * User: Jeremy + * Date: 09/08/2012 + * Time: 16:14 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ + +read tools/basis.anubis +read system/string.anubis +read system/convert.anubis +read calexium_lib/web/CXM_common.anubis +read calexium_lib/web/CXM_multihost_http_server.anubis + +/* Provides a dump of Web_arg List */ +public define String + dump_web_arg_values + ( + List(Web_arg) l, + ) + = + if l is + { + [ ] then "\n", + [h . t] then if h is + { + web_arg(n,v) then "\n["+n+"] = '"+v+"'" + dump_web_arg_values(t), + upload(n,v,tfn) then "\n["+n+"] = '"+v+"'" + dump_web_arg_values(t) + } + } + . + +/* Provides a dump of HTTP_Header List */ +public define String + dump_http_headers + ( + List(HTTP_header) l, + ) + = + if l is + { + [ ] then "", // no need to add \n => previous call has made it + [h . t] then "`\t" + h.name + " : " + h.value + "\n" + dump_http_headers(t) + } + . + +/* Provides a dump of a HTTP_Info */ +public define String + dump_http_info + ( + HTTP_Info http_info, + ) + = + /* + * Word32 ip_address, // IP address of the client + String hostname, // hostname requested by the client + String uri, // URI requested by the client + List(HTTP_header) http_headers, // HTTP headers sent by the client + Bool is_https, + One -> String generate_trust_ticket // may be used against denial of + */ + "IP Address : " + http_info.ip_address + "\n" + + "Hostname : " + http_info.hostname + "\n" + + "URI : " + http_info.uri + "\n" + + "HTTP Headers : " + dump_http_headers(http_info.http_headers) // no need to add \n => dump_http_headers does it + + "Is HTTPS : " + to_String(http_info.is_https) + "\n" + . + -- libgit2 0.21.4