@@ -164,7 +164,7 @@ module Request = struct
164164 type 'body t = {
165165 meth : Meth .t ;
166166 host : string ;
167- client_addr : Unix .sockaddr option ;
167+ client_addr : Unix .sockaddr ;
168168 headers : Headers .t ;
169169 http_version : int * int ;
170170 path : string ;
@@ -246,7 +246,7 @@ module Request = struct
246246 bad_reqf 400 " body is too short by %d bytes" size)
247247
248248 (* parse request, but not body (yet) *)
249- let parse_req_start ? client_addr ~get_time_s ~buf (bs : byte_stream ) :
249+ let parse_req_start ~ client_addr ~get_time_s ~buf (bs : byte_stream ) :
250250 unit t option resp_result =
251251 try
252252 let line = Byte_stream. read_line ~buf bs in
@@ -342,8 +342,8 @@ module Request = struct
342342 | e -> bad_reqf 500 " failed to read body: %s" (Printexc. to_string e)
343343
344344 module Internal_ = struct
345- let parse_req_start ?(buf = Buf. create () ) ~get_time_s bs =
346- parse_req_start ~get_time_s ~buf bs |> unwrap_resp_result
345+ let parse_req_start ?(buf = Buf. create () ) ~client_addr ~ get_time_s bs =
346+ parse_req_start ~client_addr ~ get_time_s ~buf bs |> unwrap_resp_result
347347
348348 let parse_body ?(buf = Buf. create () ) req bs : _ t =
349349 parse_body_ ~tr_stream: (fun s -> s) ~buf { req with body = bs }
@@ -1017,15 +1017,15 @@ let find_map f l =
10171017 aux f l
10181018
10191019(* handle client on [ic] and [oc] *)
1020- let client_handle_for (self : t ) ? client_addr ic oc : unit =
1020+ let client_handle_for (self : t ) ~ client_addr ic oc : unit =
10211021 Pool. with_resource self.buf_pool @@ fun buf ->
10221022 Pool. with_resource self.buf_pool @@ fun buf_res ->
10231023 let is = Byte_stream. of_input ~buf_size: self.buf_size ic in
10241024 let continue = ref true in
10251025 while ! continue && running self do
10261026 _debug (fun k -> k " read next request" );
10271027 let (module B ) = self.backend in
1028- match Request. parse_req_start ? client_addr ~get_time_s: B. get_time_s ~buf is with
1028+ match Request. parse_req_start ~ client_addr ~get_time_s: B. get_time_s ~buf is with
10291029 | Ok None -> continue := false (* client is done *)
10301030 | Error (c , s ) ->
10311031 (* connection error, close *)
0 commit comments