@@ -1215,6 +1215,11 @@ defmodule Plug.Conn do
12151215 * `:read_timeout` - sets the timeout for each socket read, defaults to
12161216 `5_000` milliseconds
12171217
1218+ > #### Request length {: .warning}
1219+ >
1220+ > The `:length` option tracks the maximum length within a single call.
1221+ > When doing multiple across to `read_part_headers/2` and `read_part_body/2`,
1222+ > it is your responsability to track the overall response length.
12181223 """
12191224 @ spec read_part_headers ( t , Keyword . t ( ) ) ::
12201225 { :ok , headers , t } | { :error , :too_large , t } | { :done , t }
@@ -1258,6 +1263,21 @@ defmodule Plug.Conn do
12581263 if there is no more body.
12591264
12601265 It accepts the same options as `read_body/2`.
1266+
1267+ ## Options
1268+
1269+ * `:length` - sets the maximum number of bytes to read from the body on
1270+ every call, defaults to `8_000_000` bytes
1271+ * `:read_length` - sets the amount of bytes to read at one time from the
1272+ underlying socket to fill the chunk, defaults to `1_000_000` bytes
1273+ * `:read_timeout` - sets the timeout for each socket read, defaults to
1274+ `15_000` milliseconds
1275+
1276+ > #### Request length {: .warning}
1277+ >
1278+ > The `:length` option tracks the maximum length within a single call.
1279+ > When doing multiple across to `read_part_headers/2` and `read_part_body/2`,
1280+ > it is your responsability to track the overall response length.
12611281 """
12621282 @ spec read_part_body ( t , Keyword . t ( ) ) :: { :ok , binary , t } | { :more , binary , t } | { :done , t }
12631283 def read_part_body ( % Conn { adapter: { adapter , state } } = conn , opts ) do
0 commit comments