Skip to content

Commit 343f1b7

Browse files
committed
http/stream_common: Have :write_body_from_file take an table as argument
1 parent 9692e2e commit 343f1b7

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

interfaces/stream.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ Writes the string `chunk` to the stream. If `end_stream` is true, the body will
8989
Writes the string `str` to the stream and ends the stream. On error, returns `nil`, an error message and an error number.
9090

9191

92-
### `stream:write_body_from_file(file, timeout)` <!-- --> {#stream:write_body_from_file}
92+
### `stream:write_body_from_file(options|file, timeout)` <!-- --> {#stream:write_body_from_file}
93+
94+
- `options` is a table containing:
95+
- `.file` (file)
9396

9497
Writes the contents of file `file` to the stream and ends the stream. `file` will not be automatically seeked, so ensure it is at the correct offset before calling. On error, returns `nil`, an error message and an error number.
9598

modules/http.h1_stream.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ See [`stream:write_chunk(chunk, end_stream, timeout)`](#stream:write_chunk)
9494
See [`stream:write_body_from_string(str, timeout)`](#stream:write_body_from_string)
9595

9696

97-
### `h1_stream:write_body_from_file(file, timeout)` <!-- --> {#http.h1_stream:write_body_from_file}
97+
### `h1_stream:write_body_from_file(options|file, timeout)` <!-- --> {#http.h1_stream:write_body_from_file}
9898

99-
See [`stream:write_body_from_file(file, timeout)`](#stream:write_body_from_file)
99+
See [`stream:write_body_from_file(options|file, timeout)`](#stream:write_body_from_file)
100100

101101

102102
### `h1_stream:shutdown()` <!-- --> {#http.h1_stream:shutdown}

modules/http.h2_stream.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ See [`stream:write_chunk(chunk, end_stream, timeout)`](#stream:write_chunk)
8787
See [`stream:write_body_from_string(str, timeout)`](#stream:write_body_from_string)
8888

8989

90-
### `h2_stream:write_body_from_file(file, timeout)` <!-- --> {#http.h2_stream:write_body_from_file}
90+
### `h2_stream:write_body_from_file(options|file, timeout)` <!-- --> {#http.h2_stream:write_body_from_file}
9191

92-
See [`stream:write_body_from_file(file, timeout)`](#stream:write_body_from_file)
92+
See [`stream:write_body_from_file(options|file, timeout)`](#stream:write_body_from_file)
9393

9494

9595
### `h2_stream:shutdown()` <!-- --> {#http.h2_stream:shutdown}

0 commit comments

Comments
 (0)