Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* Add support for proxy types CURLPROXY_HTTPS and CURLPROXY_HTTPS2.
(Volker Diels-Grabsch)
* Add support for CURLOPT_UNIX_SOCKET_PATH.
(Volker Diels-Grabsch)

## 0.10.0 - 14 May 2025

Expand Down
1 change: 1 addition & 0 deletions config/discover.ml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ let curl_h_declarations = [
"CURLOPT_TIMEOUT_MS";
"CURLOPT_TIMEVALUE";
"CURLOPT_TRANSFERTEXT";
"CURLOPT_UNIX_SOCKET_PATH";
"CURLOPT_UNRESTRICTED_AUTH";
"CURLOPT_UPLOAD";
"CURLOPT_URL";
Expand Down
9 changes: 9 additions & 0 deletions curl-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3459,6 +3459,10 @@ SETOPT_LONG( BUFFERSIZE)
SETOPT_STRING( AWS_SIGV4)
#endif

#if HAVE_DECL_CURLOPT_UNIX_SOCKET_PATH
SETOPT_STRING( UNIX_SOCKET_PATH)
#endif

/* Windows headers define these symbols and there is no (sane) way to
* prevent macro expansion */

Expand Down Expand Up @@ -3921,6 +3925,11 @@ HAVE(TCP_KEEPALIVE),
HAVE(TCP_KEEPIDLE),
HAVE(TCP_KEEPINTVL),
HAVE(NOPROXY),
#if HAVE_DECL_CURLOPT_UNIX_SOCKET_PATH
HAVE(UNIX_SOCKET_PATH),
#else
HAVENOT(UNIX_SOCKET_PATH),
#endif
};

value caml_curl_easy_setopt(value conn, value option)
Expand Down
5 changes: 5 additions & 0 deletions curl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ type curlOption =
| CURLOPT_TCP_KEEPIDLE of int
| CURLOPT_TCP_KEEPINTVL of int
| CURLOPT_NOPROXY of string
| CURLOPT_UNIX_SOCKET_PATH of string

type initOption =
| CURLINIT_GLOBALALL
Expand Down Expand Up @@ -1165,6 +1166,9 @@ let set_proxy_ssl_options conn opts =
let set_noproxy conn s =
setopt conn (CURLOPT_NOPROXY s)

let set_unix_socket_path conn unix_socket_path =
setopt conn (CURLOPT_UNIX_SOCKET_PATH unix_socket_path)

let get_effectiveurl conn =
match (getinfo conn CURLINFO_EFFECTIVE_URL) with
| CURLINFO_String s -> s
Expand Down Expand Up @@ -1527,6 +1531,7 @@ class handle =
method set_tcpkeepidle seconds = set_tcpkeepidle conn seconds
method set_tcpkeepintvl seconds = set_tcpkeepintvl conn seconds
method set_noproxy s = set_noproxy conn s
method set_unix_socket_path unix_socket_path = set_unix_socket_path conn unix_socket_path

method get_effectiveurl = get_effectiveurl conn
method get_redirecturl = get_redirecturl conn
Expand Down
3 changes: 3 additions & 0 deletions curl.mli
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ type curlOption =
| CURLOPT_TCP_KEEPIDLE of int
| CURLOPT_TCP_KEEPINTVL of int
| CURLOPT_NOPROXY of string
| CURLOPT_UNIX_SOCKET_PATH of string (* @since libcurl 7.40.0 *)

type initOption =
| CURLINIT_GLOBALALL
Expand Down Expand Up @@ -911,6 +912,7 @@ val set_mimepost : t -> curlMIMEPart list -> unit
val set_sshknownhosts : t -> string -> unit
val set_sshkeyfunction : t -> (curlKHMatch -> string -> curlKHStat) -> unit
val set_noproxy : t -> string -> unit
val set_unix_socket_path : t -> string -> unit

(** {2 Get transfer properties} *)

Expand Down Expand Up @@ -1129,6 +1131,7 @@ class handle :
method set_tcpkeepidle : int -> unit
method set_tcpkeepintvl : int -> unit
method set_noproxy : string -> unit
method set_unix_socket_path : string -> unit

method get_effectiveurl : string
method get_redirecturl : string
Expand Down
Loading