File: tmod1.lua

package info (click to toggle)
lua-cgi 6.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 956 kB
  • sloc: javascript: 2,216; makefile: 25
file content (24 lines) | stat: -rwxr-xr-x 562 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- $Id: tmod1.lua,v 1.1 2004/03/25 19:31:05 tomas Exp $
ap.set_content_type"text/html"

ap.rputs "ap.args = {"
ap.rputs (ap.args() or '')
ap.rputs "}<br>\n"

assert (ap.setup_client_block ("REQUEST_CHUNKED_ERROR") == ap.OK)
if ap.should_client_block () ~= 0 then
	post_data = {}
	local block, err = ap.get_client_block ()
	while block do
		table.insert (post_data, block)
		block, err = ap.get_client_block ()
	end
	if err then
		error (err)
	end
	post_data = table.concat (post_data)
end

ap.rputs "post_data = {"
ap.rputs (tostring (post_data))
ap.rputs "}\n"