Skip to content

Commit 7e81142

Browse files
committed
http/*_common.tld: Fix incomplete interface definitions
1 parent 56eca7a commit 7e81142

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

http/connection_common.tld

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ interface connection
1414

1515
-- Not in connection_common.lua
1616
const version: integer
17-
const unget: (self, string) -> (true)
17+
-- XXX: needs circular require https://github.com/andremm/typedlua/issues/120
18+
-- const new_stream: (self) -> (stream)|(nil) -- Note: in http2 this takes optional id argument
19+
-- const get_next_incoming_stream: (self, number?) -> (stream)|(nil)|(nil, string, number)
1820
const shutdown: (self) -> (true)
1921
end

http/stream_common.tld

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ interface stream
55
const localname: (self) -> (integer, string, integer?)|(nil)|(nil, string, number)
66
const peername: (self) -> (integer, string, integer?)|(nil)|(nil, string, number)
77
const write_continue: (self, number?) -> (true)|(nil, string, number)
8-
const each_chunk: (self) -> ()
8+
const each_chunk: (self) -> ((stream)->(string)|(nil)|(nil, string, number), self)
99
const get_body_as_string: (self, number?) -> (string)|(nil, string, number)
1010
const get_body_chars: (self, integer, number?) -> (string)|(nil, string, number)
1111
const get_body_until: (self, string, boolean, boolean, number?) -> (string)|(nil, string, number)
1212
const save_body_to_file: (self, file, number?) -> (true)|(nil, string, number)
1313
const get_body_as_file: (self, number?) -> (file)|(nil, string, number)
1414
const write_body_from_string: (self, string, number?) -> (true)|(nil, string, number)
1515
const write_body_from_file: (self, {"file":file, "count": integer?}|file, number?) -> (true)|(nil, string, number)
16+
1617
-- Not in stream_common.lua
1718
const connection: connection
19+
const get_headers: (self, number?) -> (headers)|(nil)|(nil, string, number)
20+
const get_next_chunk: (self, number?) -> (string)|(nil)|(nil, string, number)
1821
const write_headers: (self, headers, boolean, number?) -> (true)|(nil, string, number)
1922
const write_chunk: (self, string, boolean, number?) -> (true)|(nil, string, number)
2023
const unget: (self, string) -> (true)

0 commit comments

Comments
 (0)