Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type t =
let default =
{ (* This is effectively MAX_FRAME_SIZE, because the parser commits the frame
* header to prevent backtracking, therefore the entire payload can fit the
* read buffer. The default is 16384, and can't be lower than that.
* read buffer. The default is 65536, and can't be lower than 16384.
*
* Note: h2 does not check that MAX_FRAME_SIZE is lower than 16384
* octets. In the case that a lower value than permitted is set, peers will
Expand All @@ -57,7 +57,7 @@ let default =
* The initial value is 2^14 (16,384) octets. The value advertised by an
* endpoint MUST be between this initial value and the maximum allowed
* frame size (2^24-1 or 16,777,215 octets), inclusive. *)
read_buffer_size = Settings.default.max_frame_size
read_buffer_size = 0x10000
; (* Buffer size for request bodies *) request_body_buffer_size = 0x1000
; (* Buffer size for response bodies *) response_body_buffer_size = 0x1000
; enable_server_push = true
Expand Down
2 changes: 1 addition & 1 deletion lib/h2.mli
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ module Config : sig
type t =
{ read_buffer_size : int
(** [read_buffer_size] specifies the size of the largest frame payload that
the sender is willing to receive, in octets. Defaults to [16384] *)
the sender is willing to receive, in octets. Defaults to [65536] *)
; request_body_buffer_size : int (** Defaults to [4096] *)
; response_body_buffer_size : int (** Defaults to [4096] *)
; enable_server_push : bool (** Defaults to [true] *)
Expand Down
7 changes: 6 additions & 1 deletion lib_test/test_h2_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,12 @@ module Client_connection_tests = struct
frames)

let test_fragmented_request_body_chunking () =
let t = create_and_handle_preface () in
let config =
{ Config.default with
read_buffer_size = Settings.default.max_frame_size
}
in
let t = create_and_handle_preface ~config () in
let request = Request.create ~scheme:"http" `POST "/" in
let response_handler _response _response_body = () in
let request_body =
Expand Down
1 change: 1 addition & 0 deletions lib_test/test_h2_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ module Server_connection_tests = struct
= { Settings.default with
enable_push = false
; max_concurrent_streams = 2l
; max_frame_size = Config.default.read_buffer_size
});
(match next_write_operation t with
| `Write iovecs ->
Expand Down
Loading