Skip to content

Commit

Permalink
Revert "Don't even call the handler unless status is 200"
Browse files Browse the repository at this point in the history
This reverts commit 385d4df.
  • Loading branch information
quernd authored and tmcgilchrist committed Aug 5, 2023
1 parent d1f3d49 commit ffd50f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/grpc-async/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ let call ~service ~rpc ?(scheme = "https") ~handler ~do_request
request
~response_handler:(response_handler read_body_ivar out_ivar)
in
let%bind handler_res = handler write_body (Ivar.read read_body_ivar) in
let%bind response = Ivar.read out_ivar in
match response.status with
| `OK ->
let%bind handler_res = handler write_body (Ivar.read read_body_ivar) in
let%map status =
match H2.Headers.get headers "grpc-status" with
| Some _ -> return (Grpc.Status.extract_status headers)
Expand Down
2 changes: 1 addition & 1 deletion lib/grpc-lwt/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ let call ~service ~rpc ?(scheme = "https") ~handler ~(do_request : do_request)
~response_handler:(response_handler read_body_notify response_notify)
~trailers_handler:(trailers_handler status_notify)
in
let* handler_res = handler write_body read_body in
let* response = response in
match response.status with
| `OK ->
let* handler_res = handler write_body read_body in
let+ status =
match H2.Headers.get headers "grpc-status" with
| Some _ -> Lwt.return (Grpc.Status.extract_status headers)
Expand Down

0 comments on commit ffd50f1

Please sign in to comment.