@@ -488,30 +488,33 @@ let%expect_test "Persistent clients will re-connect if connection is closed" =
488488;;
489489
490490let % expect_test " Request goes past max buffer size" =
491- Monitor. try_with (fun () ->
492- Helper. with_server ~buf_len: 32 ~max_buffer_size: 32 handler ~f: (fun port ->
493- Helper. with_client port ~f: (fun r w ->
494- let test_post_req_with_fixed_body =
495- " POST /hello HTTP/1.1\r\n \
496- Host: www.example.com \r\n \
497- Content-Length: 5\r\n \
498- Connection: close\r\n \
499- \r\n \
500- Hello\r\n "
501- in
502- Helper. send_request_and_log_response r w test_post_req_with_fixed_body)))
503- >> = function
504- | Ok () ->
505- printf " got result" ;
506- Deferred. unit
507- | Error exn ->
508- (match Monitor. extract_exn exn with
509- | Bytebuffer. Maximum_buffer_size_exceeded { new_length_requested; current_length } ->
510- printf
511- " Current length: %d, New length requested: %d"
512- current_length
513- new_length_requested;
514- [% expect {| Current length : 32 , New length requested : 34 |}];
515- Deferred. unit
516- | exn -> raise exn )
491+ let % map () =
492+ Monitor. try_with (fun () ->
493+ Helper. with_server ~buf_len: 32 ~max_buffer_size: 32 handler ~f: (fun port ->
494+ Helper. with_client port ~f: (fun r w ->
495+ let test_post_req_with_fixed_body =
496+ " POST /hello HTTP/1.1\r\n \
497+ Host: www.example.com \r\n \
498+ Content-Length: 5\r\n \
499+ Connection: close\r\n \
500+ \r\n \
501+ Hello\r\n "
502+ in
503+ Helper. send_request_and_log_response r w test_post_req_with_fixed_body)))
504+ >> = function
505+ | Ok () ->
506+ printf " got result" ;
507+ Deferred. unit
508+ | Error exn ->
509+ (match Monitor. extract_exn exn with
510+ | Bytebuffer. Maximum_buffer_size_exceeded { new_length_requested; current_length }
511+ ->
512+ printf
513+ " Current length: %d, New length requested: %d"
514+ current_length
515+ new_length_requested;
516+ Deferred. unit
517+ | exn -> raise exn )
518+ in
519+ [% expect {| Current length : 32 , New length requested : 34 |}]
517520;;
0 commit comments