Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

143 lines (104 sloc) 5.473 kb
(*
Copyright © 2011 MLstate
This file is part of OPA.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
(** HttpTools:
Just some support routines for handling HTTP requests and responses.
*)
val http : NetAddr.protocol
(** Possible exceptions *)
exception CallbackAbort
(** Timing functions. *)
val rpt : int -> ('a -> 'b) -> 'a -> unit
val timefn : int -> ('a -> 'b) -> 'a -> unit
val verifyfn : ('a -> 'b) -> ('a -> string) -> ('b -> string) -> ('a * 'b) list -> bool
(** Basic string functions *)
val strcom : string -> int -> string * string option
val rmldtrsp0 : string -> int -> string
val rmldtrsp : string -> string
val rmldtrsp2 : string * string -> string * string
val rmldtrspl : string list -> string list
(** String based support for raw parser *)
val pos_mark : ('a -> int -> 'b) -> 'a -> int -> 'a -> int -> int -> (int * int) option
val upto_mark : string -> int -> string -> int -> int -> int * int * string
val upto_mark_ci : string -> int -> string -> int -> int -> int * int * string
(** Streaming parsers *)
val buf_clean : (Buffer.t * int ref) -> unit
val upto_mark_stream : ('a -> char) -> 'a -> string -> string
val get_char_cps : ('a -> ('b * string -> 'c) -> 'c) -> string ref * int ref * 'a -> (char -> 'c) -> 'c
val upto_mark_stream_cps : ?inclusive:bool -> Buffer.t -> ('a -> (char -> 'b) -> 'b) -> 'a -> string -> (string -> 'b) -> 'b
val upto_mark_stream_cps2 :
?inclusive:bool -> (*?oc_opt:out_channel option ->*) Scheduler.t -> Scheduler.connection_info -> (Buffer.t * int ref) -> string ->
?callback:('a -> int -> Buffer.t -> bool) -> 'a -> ?blocksize:int ->
?err_cont:(exn -> unit) -> ?timeout:Time.t -> (Buffer.t * int * int -> unit) -> unit
val upto_mark_stream_cps3 :
?inclusive:bool -> (*?oc_opt:out_channel option ->*) Scheduler.t -> Scheduler.connection_info -> (Buffer.t * int ref) -> string ->
?callback:('a -> int -> Buffer.t -> bool) -> 'a -> ?blocksize:int ->
?err_cont:(exn -> unit) -> ?timeout:Time.t -> (string -> unit) -> unit
val upto_stream_cps :
?inclusive:bool ->
Buffer.t ->
('a -> ('b * string -> 'c) -> 'c) ->
string ref * int ref * 'a -> string -> (string -> 'c) -> 'c
val read_upto_stream_cps :
?inclusive:bool ->
Buffer.t ->
string ref * int ref * Scheduler.connection_info ->
string ->
Scheduler.t ->
?err_cont:(exn -> unit) -> ?timeout:Time.t -> (string -> unit) -> unit
val fixed_stream_cps :
Buffer.t ->
('a -> ('b * string -> 'c) -> 'c) ->
string ref * int ref * 'a -> int -> (string -> 'c) -> 'c
val read_fixed_stream_cps :
Buffer.t ->
string ref * int ref * Scheduler.connection_info ->
int ->
Scheduler.t ->
?err_cont:(exn -> unit) -> ?timeout:Time.t -> (string -> unit) -> unit
val fixed_stream_cps2_buf :
(*?oc_opt:out_channel option ->*) Scheduler.t -> Scheduler.connection_info -> (Buf.t * int ref) -> int ->
?callback:('a -> int -> Buf.t -> bool) -> 'a -> ?blocksize:int ->
?err_cont:(exn -> unit) -> ?timeout:Time.t -> (Buf.t * int * int -> unit) -> unit
val fixed_stream_cps2 :
(*?oc_opt:out_channel option ->*) Scheduler.t -> Scheduler.connection_info -> (Buffer.t * int ref) -> int ->
?callback:('a -> int -> Buffer.t -> bool) -> 'a -> ?blocksize:int ->
?err_cont:(exn -> unit) -> ?timeout:Time.t -> (Buffer.t * int * int -> unit) -> unit
val fixed_stream_cps3 :
(*?oc_opt:out_channel option ->*) Scheduler.t -> Scheduler.connection_info -> (Buffer.t * int ref) -> int ->
?callback:('a -> int -> Buffer.t -> bool) -> 'a -> ?blocksize:int ->
?err_cont:(exn -> unit) -> ?timeout:Time.t -> (string -> unit) -> unit
val upto : string -> ('a -> ('b * string -> 'c) -> 'c) -> string ref * int ref * 'a -> (string -> 'c) -> 'c
(** putback string onto protocol input *)
val putback : string -> string ref * int ref * 'a -> unit
val putback2 : string -> Buffer.t * int ref -> unit
(** Fast-forward functions *)
val skip_sptab : string -> int -> int -> int
val skip_lws : string -> int -> int -> int
(** More streaming functions *)
val upto_mark_lws : string -> int -> string -> int -> int -> int * int * string
val upto_mark_lws_ci : string -> int -> string -> int -> int -> int * int * string
(** Overflow from rcontent *)
(** content_compress gzip deflate compression_level cache_response content content_len:
Compress file content according to gzip/deflate flags (deflate has priority).
Does not read file in if file content, writes from/to disc.
*)
val content_compress : Scheduler.t -> bool -> bool -> int -> bool -> Rcontent.content -> int ->
((bool * Rcontent.content) -> unit) -> unit
(** Simple buffer management *)
val collect_bufs : int -> unit
val get_buf : ?hint:int -> unit -> Buffer.t
val free_buf : Buffer.t -> unit
(** SSL certificate generation *)
val make_ssl_cert : string -> string -> string -> SslAS.ssl_certificate option
val make_ssl_verify : string -> string -> string -> string -> (Ssl.certificate -> bool) -> bool -> SslAS.ssl_verify_params option
Jump to Line
Something went wrong with that request. Please try again.