Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redoing PR for Travis #133

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions lib/conduit_async.ml
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,30 @@ type ic = Reader.t
type oc = Writer.t

type addr = [
| `OpenSSL of string * Ipaddr.t * int
| `OpenSSL_with_config of string * Ipaddr.t * int * Ssl.config
| `TCP of Ipaddr.t * int
| `OpenSSL of string * int
| `OpenSSL_with_config of string * int * Ssl.config
| `TCP of string * int
| `Unix_domain_socket of string
] [@@deriving sexp]

let connect ?interrupt dst =
match dst with
| `TCP (ip, port) -> begin
Tcp.connect ?interrupt (Tcp.to_host_and_port (Ipaddr.to_string ip) port)
| `TCP (host, port) -> begin
Tcp.connect ?interrupt (Tcp.to_host_and_port host port)
>>= fun (_, rd, wr) -> return (rd,wr)
end
| `OpenSSL (host, ip, port) -> begin
| `OpenSSL (host, port) -> begin
#if HAVE_ASYNC_SSL
Tcp.connect ?interrupt (Tcp.to_host_and_port (Ipaddr.to_string ip) port)
Tcp.connect ?interrupt (Tcp.to_host_and_port host port)
>>= fun (_, rd, wr) ->
Conduit_async_ssl.ssl_connect rd wr
#else
raise Ssl_unsupported
#endif
end
| `OpenSSL_with_config (host, ip, port, config) -> begin
| `OpenSSL_with_config (host, port, config) -> begin
#if HAVE_ASYNC_SSL
Tcp.connect ?interrupt (Tcp.to_host_and_port (Ipaddr.to_string ip) port)
Tcp.connect ?interrupt (Tcp.to_host_and_port host port)
>>= fun (_, rd, wr) ->
let open Ssl in
match config with | {version; name; ca_file; ca_path; session; verify} ->
Expand Down
6 changes: 3 additions & 3 deletions lib/conduit_async.mli
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ type ic = Reader.t
type oc = Writer.t

type addr = [
| `OpenSSL of string * Ipaddr.t * int
| `OpenSSL_with_config of string * Ipaddr.t * int * Ssl.config
| `TCP of Ipaddr.t * int
| `OpenSSL of string * int
| `OpenSSL_with_config of string * int * Ssl.config
| `TCP of string * int
| `Unix_domain_socket of string
] [@@deriving sexp]

Expand Down