Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 155 lines (135 sloc) 5.319 kB
21abc5b @klacke Initial revision
authored
1 %%%----------------------------------------------------------------------
2 %%% File : yaws_api.hrl
3 %%% Author : Claes Wikstrom <klacke@hyber.org>
455578a @vinoski major trailing whitespace cleanup
vinoski authored
4 %%% Purpose :
21abc5b @klacke Initial revision
authored
5 %%% Created : 24 Jan 2002 by Claes Wikstrom <klacke@hyber.org>
6 %%%----------------------------------------------------------------------
7
8 -author('klacke@hyber.org').
9
10 -record(arg, {
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
11 clisock, % the socket leading to the peer client
12 client_ip_port, % {ClientIp, ClientPort} tuple
13 headers, % headers
14 req, % request
15 clidata, % The client data (as a binary in POST requests)
16 server_path, % The normalized server path
17 % (pre-querystring part of URI)
18 querydata, % For URIs of the form ...?querydata
19 % equiv of cgi QUERY_STRING
20 appmoddata, % (deprecated - use pathinfo instead) the remainder
21 % of the path leading up to the query
22 docroot, % Physical base location of data for this request
23 docroot_mount, % virtual directory e.g /myapp/ that the docroot
24 % refers to.
25 fullpath, % full deep path to yaws file
26 cont, % Continuation for chunked multipart uploads
27 state, % State for use by users of the out/1 callback
28 pid, % pid of the yaws worker process
29 opaque, % useful to pass static data
30 appmod_prepath, % (deprecated - use prepath instead) path in front
31 % of: <appmod><appmoddata>
32 prepath, % Path prior to 'dynamic' segment of URI.
33 % ie http://some.host/<prepath>/<script-point>/d/e
34 % where <script-point> is an appmod mount point,
35 % or .yaws,.php,.cgi,.fcgi etc script file.
36 pathinfo % Set to '/d/e' when calling c.yaws for the request
37 % http://some.host/a/b/c.yaws/d/e
38 % equiv of cgi PATH_INFO
d0caaf6 @klacke tabs cleanup
authored
39 }).
21abc5b @klacke Initial revision
authored
40
41
42 -record(http_request, {method,
d0caaf6 @klacke tabs cleanup
authored
43 path,
44 version}).
21abc5b @klacke Initial revision
authored
45
8e69e2c @klacke first almost working vsn of revproxy
authored
46 -record(http_response, {version,
d0caaf6 @klacke tabs cleanup
authored
47 status,
48 phrase}).
8e69e2c @klacke first almost working vsn of revproxy
authored
49
f983a1b @capflam arg_rewrite mods can now return HTTP responses (capflam)
capflam authored
50 -record(rewrite_response, {status,
51 headers = [],
52 content = <<>>}).
53
21abc5b @klacke Initial revision
authored
54 -record(headers, {
d0caaf6 @klacke tabs cleanup
authored
55 connection,
56 accept,
57 host,
58 if_modified_since,
59 if_match,
60 if_none_match,
61 if_range,
62 if_unmodified_since,
63 range,
64 referer,
65 user_agent,
66 accept_ranges,
67 cookie = [],
68 keep_alive,
69 location,
70 content_length,
71 content_type,
72 content_encoding,
73 authorization,
74 transfer_encoding,
a1e2e74 @lefant add implementation of X-Forwarded-For header (Fabian Linzberger)
lefant authored
75 x_forwarded_for,
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
76 other = [] % misc other headers
d0caaf6 @klacke tabs cleanup
authored
77 }).
21abc5b @klacke Initial revision
authored
78
79
80
81
8da2b3a @klacke parse_url
authored
82 -record(url,
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
83 {scheme, % undefined means not set
84 host, % undefined means not set
85 port, % undefined means not set
d0caaf6 @klacke tabs cleanup
authored
86 path = [],
87 querypart = []}).
a1b8e0c Added set cookie parser
Johan Bevemyr authored
88
89
90 -record(setcookie,{
455578a @vinoski major trailing whitespace cleanup
vinoski authored
91 key,
92 value,
3a8e071 @capflam Fix parse_set_cookie/1 and format_set_cookie/1 functions
capflam authored
93 quoted = false,
d0caaf6 @klacke tabs cleanup
authored
94 comment,
95 comment_url,
3a8e071 @capflam Fix parse_set_cookie/1 and format_set_cookie/1 functions
capflam authored
96 discard = false,
d0caaf6 @klacke tabs cleanup
authored
97 domain,
98 max_age,
99 expires,
100 path,
101 port,
3a8e071 @capflam Fix parse_set_cookie/1 and format_set_cookie/1 functions
capflam authored
102 secure = false,
d0caaf6 @klacke tabs cleanup
authored
103 version}).
a1b8e0c Added set cookie parser
Johan Bevemyr authored
104
dbab7a3 @klacke ssi include with var expansion + docs
authored
105
3a8e071 @capflam Fix parse_set_cookie/1 and format_set_cookie/1 functions
capflam authored
106 -record(cookie,{
107 key,
108 value,
109 quoted = false,
110 version = "0",
111 domain,
112 path,
113 port}).
114
115
883fa5a @klacke added redirect_self to yaws_api
authored
116 -record(redir_self, {
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
117 host, % string() - our own host
118 scheme, % http | https
119 scheme_str, % "https://" | "http://"
120 port, % integer() - our own port
121 port_str % "" | ":<int>" - the optional port part
122 % to append to the url
883fa5a @klacke added redirect_self to yaws_api
authored
123 }).
b2d5a00 @klacke postvar(), queryvar(), ssi docs
authored
124
39c8d49 @jbothma update WebSockets implementation to support RFC 6455
jbothma authored
125 %% Corresponds to the frame sections as in
126 %% http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-08#section-4
127 %% plus 'data' and 'ws_state'
128 -record(ws_frame_info, {
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
129 fin,
130 rsv,
131 opcode,
132 masked,
133 masking_key,
134 length,
135 payload,
136 data, % The unmasked payload. Makes payload redundant.
137 ws_state % The ws_state after unframing this frame.
138 % This is useful for the endpoint to know what type of
139 % fragment a potentially fragmented message is.
140 }).
141
142 %%----------------------------------------------------------------------
143 %% The state of a WebSocket connection.
144 %% This is held by the ws owner process and passed in calls to yaws_api.
145 %%----------------------------------------------------------------------
39c8d49 @jbothma update WebSockets implementation to support RFC 6455
jbothma authored
146 -type frag_type() :: text
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
147 | binary
148 | none. % The WebSocket is not expecting continuation
149 % of any fragmented message.
39c8d49 @jbothma update WebSockets implementation to support RFC 6455
jbothma authored
150 -record(ws_state, {
88996d8 @vinoski cosmetic comment and whitespace cleanup in yaws_api.hrl
vinoski authored
151 vsn :: integer(), % WebSocket version number
152 sock, % gen_tcp or gen_ssl socket
153 frag_type :: frag_type()
154 }).
Something went wrong with that request. Please try again.