From ae818f397e3c69c5966d0393bfaf6bba43c24665 Mon Sep 17 00:00:00 2001 From: ygrek Date: Fri, 10 Jun 2016 18:18:27 +0300 Subject: [PATCH] + CURLOPT_PIPEWAIT --- config.h.in | 4 ++++ configure | 13 +++++++++++++ configure.in | 2 +- curl-helper.c | 12 +++++++++--- curl.ml | 4 ++++ curl.mli | 2 ++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/config.h.in b/config.h.in index 17f63cb..a03dc2d 100644 --- a/config.h.in +++ b/config.h.in @@ -827,6 +827,10 @@ and to 0 if you don't. */ #undef HAVE_DECL_CURLOPT_OPENSOCKETFUNCTION +/* Define to 1 if you have the declaration of `CURLOPT_PIPEWAIT', and to 0 if + you don't. */ +#undef HAVE_DECL_CURLOPT_PIPEWAIT + /* Define to 1 if you have the declaration of `CURLOPT_PORT', and to 0 if you don't. */ #undef HAVE_DECL_CURLOPT_PORT diff --git a/configure b/configure index c42b144..dbf3639 100755 --- a/configure +++ b/configure @@ -6658,6 +6658,19 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CURLOPT_MAIL_RCPT $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "CURLOPT_PIPEWAIT" "ac_cv_have_decl_CURLOPT_PIPEWAIT" " +#include \"curl/curl.h\" + +" +if test "x$ac_cv_have_decl_CURLOPT_PIPEWAIT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CURLOPT_PIPEWAIT $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "CURLINFO_EFFECTIVE_URL" "ac_cv_have_decl_CURLINFO_EFFECTIVE_URL" " #include \"curl/curl.h\" diff --git a/configure.in b/configure.in index 4a5d873..8d176c9 100644 --- a/configure.in +++ b/configure.in @@ -123,7 +123,7 @@ CURLOPT_NEW_FILE_PERMS, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_POST301, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPT_COPYPOSTFIELDS, CURLOPT_PROXY_TRANSFER_MODE, CURLOPT_SEEKFUNCTION, CURLOPT_OPENSOCKETFUNCTION, CURLOPT_PROTOCOLS, CURLOPT_REDIR_PROTOCOLS, CURLOPT_RESOLVE, CURLOPT_DNS_SERVERS, -CURLOPT_MAIL_FROM, CURLOPT_MAIL_RCPT, +CURLOPT_MAIL_FROM, CURLOPT_MAIL_RCPT, CURLOPT_PIPEWAIT, CURLINFO_EFFECTIVE_URL, CURLINFO_RESPONSE_CODE, CURLINFO_TOTAL_TIME, CURLINFO_NAMELOOKUP_TIME, CURLINFO_CONNECT_TIME, CURLINFO_PRETRANSFER_TIME, diff --git a/curl-helper.c b/curl-helper.c index c909e76..5bcc193 100644 --- a/curl-helper.c +++ b/curl-helper.c @@ -113,12 +113,9 @@ typedef enum OcamlValues Ocaml_SSH_PRIVATE_KEYFILE, Ocaml_SSH_HOST_PUBLIC_KEY_MD5, Ocaml_COPYPOSTFIELDS, - Ocaml_DNS_SERVERS, - Ocaml_MAIL_FROM, Ocaml_MAIL_RCPT, - Ocaml_RESOLVE, /* Not used, last for size */ @@ -2736,6 +2733,10 @@ SETOPT_STRING( MAIL_FROM) SETOPT_SLIST( MAIL_RCPT) #endif +#if HAVE_DECL_CURLOPT_PIPEWAIT +SETOPT_BOOL( PIPEWAIT) +#endif + /** ** curl_easy_setopt helper function **/ @@ -3109,6 +3110,11 @@ CURLOptionMapping implementedOptionMap[] = #else MAP_NO(MAIL_RCPT), #endif +#if HAVE_DECL_CURLOPT_PIPEWAIT + IMM(PIPEWAIT), +#else + IMM_NO(PIPEWAIT), +#endif }; static Connection *duplicateConnection(Connection *original) diff --git a/curl.ml b/curl.ml index 81f77f5..9c7a455 100644 --- a/curl.ml +++ b/curl.ml @@ -396,6 +396,7 @@ type curlOption = | CURLOPT_DNS_SERVERS of string | CURLOPT_MAIL_FROM of string | CURLOPT_MAIL_RCPT of string list + | CURLOPT_PIPEWAIT of bool type initOption = | CURLINIT_GLOBALALL @@ -930,6 +931,9 @@ let set_mailfrom conn l = let set_mailrcpt conn l = setopt conn (CURLOPT_MAIL_RCPT l) +let set_pipewait conn b = + setopt conn (CURLOPT_PIPEWAIT b) + let get_effectiveurl conn = match (getinfo conn CURLINFO_EFFECTIVE_URL) with | CURLINFO_String s -> s diff --git a/curl.mli b/curl.mli index 80a899c..02e1978 100644 --- a/curl.mli +++ b/curl.mli @@ -404,6 +404,7 @@ type curlOption = | CURLOPT_DNS_SERVERS of string | CURLOPT_MAIL_FROM of string | CURLOPT_MAIL_RCPT of string list + | CURLOPT_PIPEWAIT of bool type initOption = | CURLINIT_GLOBALALL @@ -646,6 +647,7 @@ val set_resolve : t -> (string * int * string) list -> (string * int) list -> un val set_dns_servers : t -> string list -> unit val set_mailfrom : t -> string -> unit val set_mailrcpt : t -> string list -> unit +val set_pipewait : t -> bool -> unit (** {2 Get transfer properties} *) -- 2.11.4.GIT