yaws webserver specific question

MEENA SELVAM <>
Thu Jul 21 20:15:41 CEST 2005


The following record definitions are in yaws_api.hrl
Does any one know what is the type of the individual
elements of the other header? I have included a
typical  arg record with typical values of the other
record. But I am not sure how I can access the IP
address (47.80.18.95 )in the fourth element of the
other record

can i do something like this. will it work?
[_,_,_,FourthElement|_] =
(A#arg.headers)#headers.Other
[_,_,_,_,IP] = FourthElement

-record(arg, {
          clisock,        %% the socket leading to the
peer client
          headers,        %% headers
          req,            %% request
          .....
          .....
           .....
         }).

-record(headers, {
          connection,
          accept,
          host,       %% host header
          if_modified_since,
          ...
          ...
          ...
          other = []   %% misc other headers
         }).


A= {arg,#Port<16338.534>,
>                        {headers,undefined,
>                                 "image/gif,
>image/x-xbitmap, image/jpeg, image/
>pjpeg, */*",
>                                 "www.msn.com",
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 "Mozilla/4.0
>(compatible; MSIE 6.0; Windows NT
>5.1)",
>                                 undefined,
>                                 [],
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 undefined,
>                                 [{http_header,
>                                      0,
>                                     
>"X-Yaws-Had-Clicert",
>                                      undefined,
>                                      "false"},
>                                  {http_header,
>                                      49,
>                                     
>'X-Forwarded-For',
>                                      undefined,
>                                      "11.10.1.107"},
>                                  {http_header,
>                                      7,
>                                      'Via',
>                                      undefined,
>                                      "1.1
www.msn.com
>(Alteon iSD-SSL/5.5)"},
>                                  {http_header,
>                                      0,
>                                     
>"X-Forwarded-By",
>                                      undefined,
>                                      "47.80.18.95"},
>                                  {http_header,
>                                      10,
>                                     
>'Accept-Encoding',
>                                      undefined,
>                                      "gzip,
>deflate"},
>                                  {http_header,
>                                      11,
>                                     
>'Accept-Language',
>                                      undefined,
>                                      "en-us"}]},
>                       
>{http_request,'GET',{abs_path,"/"},{1,1}},
>                        undefined,
>                        "/",
>                        [],
>                        undefined,
                         ....
>                        .... and much more
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the erlang-questions mailing list