objective categorical abstract machine language personal data server

Drain body after http request when unused

futur.blue acb3a271 96aee84f

verified
+6
+3
pegasus/lib/id_resolver.ml
··· 18 18 let%lwt did = Body.to_string body in 19 19 Lwt.return_ok did 20 20 | _ -> 21 + let%lwt () = Body.drain_body body in 21 22 Lwt.return_error "failed to resolve" 22 23 with exn -> Lwt.return_error (Printexc.to_string exn) 23 24 ··· 167 168 let%lwt body = Body.to_string body in 168 169 body |> Yojson.Safe.from_string |> Document.of_yojson |> Lwt.return 169 170 | _ -> 171 + let%lwt () = Body.drain_body body in 170 172 Lwt.return_error "failed to resolve" 171 173 with e -> Lwt.return_error (Printexc.to_string e) 172 174 ··· 188 190 let%lwt body = Body.to_string body in 189 191 body |> Yojson.Safe.from_string |> Document.of_yojson |> Lwt.return 190 192 | _ -> 193 + let%lwt () = Body.drain_body body in 191 194 Lwt.return_error "failed to resolve" 192 195 with e -> Lwt.return_error (Printexc.to_string e) 193 196
+1
pegasus/lib/plc.ml
··· 237 237 let%lwt res, body = Client.post ~headers ~body endpoint in 238 238 match res.status with 239 239 | `OK -> 240 + let%lwt () = Body.drain_body body in 240 241 Lwt.return_ok () 241 242 | _ -> 242 243 let%lwt body_str = Body.to_string body in
+2
pegasus/lib/xrpc.ml
··· 92 92 let%lwt body = Body.to_string body in 93 93 Lwt.return @@ Dream.response ~status:`OK body 94 94 | e -> 95 + let%lwt () = Body.drain_body body in 95 96 Dream.error (fun log -> 96 97 log "error when proxying to %s: %s" (Uri.to_string uri) 97 98 (Http.Status.to_string e) ) ; ··· 106 107 let%lwt body = Body.to_string body in 107 108 Lwt.return @@ Dream.response ~status:`OK body 108 109 | e -> 110 + let%lwt () = Body.drain_body body in 109 111 Dream.error (fun log -> 110 112 log "error when proxying to %s: %s" (Uri.to_string uri) 111 113 (Http.Status.to_string e) ) ;