Commit fc787ae1dc6f3e25ba88d3eb5586e53436b406a7

Authored by yekolia
1 parent 03f67901

New :

- File 'web/CXM_web_dump.anubis' : contains all functions for dumping datas for web as Web_arg, HTTP_header, HTTP_Info.

Modifications :
 - Move : function 'dump_web_arg_values' is now located in 'web/CXM_web_dump.anubis'.
calexium_lib/web/CXM_common.anubis
... ... @@ -197,17 +197,3 @@ public define List(String)
197 197 }
198 198 .
199 199  
200   -public define String
201   - dump_web_arg_values
202   - (
203   - List(Web_arg) l,
204   - ) =
205   - if l is
206   - {
207   - [ ] then "\n",
208   - [h . t] then if h is
209   - {
210   - web_arg(n,v) then "\n["+n+"] = '"+v+"'" + dump_web_arg_values(t),
211   - upload(n,v,tfn) then "\n["+n+"] = '"+v+"'" + dump_web_arg_values(t)
212   - }
213   - }.
... ...
calexium_lib/web/CXM_web_dump.anubis 0 → 100644
  1 +/*
  2 + * Created by PyramIDE.
  3 + * User: Jeremy
  4 + * Date: 09/08/2012
  5 + * Time: 16:14
  6 + *
  7 + * To change this template use Tools | Options | Coding | Edit Standard Headers.
  8 + */
  9 +
  10 +read tools/basis.anubis
  11 +read system/string.anubis
  12 +read system/convert.anubis
  13 +read calexium_lib/web/CXM_common.anubis
  14 +read calexium_lib/web/CXM_multihost_http_server.anubis
  15 +
  16 +/* Provides a dump of Web_arg List */
  17 +public define String
  18 + dump_web_arg_values
  19 + (
  20 + List(Web_arg) l,
  21 + )
  22 + =
  23 + if l is
  24 + {
  25 + [ ] then "\n",
  26 + [h . t] then if h is
  27 + {
  28 + web_arg(n,v) then "\n["+n+"] = '"+v+"'" + dump_web_arg_values(t),
  29 + upload(n,v,tfn) then "\n["+n+"] = '"+v+"'" + dump_web_arg_values(t)
  30 + }
  31 + }
  32 + .
  33 +
  34 +/* Provides a dump of HTTP_Header List */
  35 +public define String
  36 + dump_http_headers
  37 + (
  38 + List(HTTP_header) l,
  39 + )
  40 + =
  41 + if l is
  42 + {
  43 + [ ] then "", // no need to add \n => previous call has made it
  44 + [h . t] then "`\t" + h.name + " : " + h.value + "\n" + dump_http_headers(t)
  45 + }
  46 + .
  47 +
  48 +/* Provides a dump of a HTTP_Info */
  49 +public define String
  50 + dump_http_info
  51 + (
  52 + HTTP_Info http_info,
  53 + )
  54 + =
  55 + /*
  56 + * Word32 ip_address, // IP address of the client
  57 + String hostname, // hostname requested by the client
  58 + String uri, // URI requested by the client
  59 + List(HTTP_header) http_headers, // HTTP headers sent by the client
  60 + Bool is_https,
  61 + One -> String generate_trust_ticket // may be used against denial of
  62 + */
  63 + "IP Address : " + http_info.ip_address + "\n"
  64 + + "Hostname : " + http_info.hostname + "\n"
  65 + + "URI : " + http_info.uri + "\n"
  66 + + "HTTP Headers : " + dump_http_headers(http_info.http_headers) // no need to add \n => dump_http_headers does it
  67 + + "Is HTTPS : " + to_String(http_info.is_https) + "\n"
  68 + .
  69 +
... ...