This is an automated email from the git hooks/post-receive script. glondu pushed a commit to branch master in repository ocurl.
commit 84966d8701c220580e5e5ccf78c8600d29aa800b Author: Stephane Glondu <st...@glondu.net> Date: Tue Feb 23 10:33:17 2016 +0100 Imported Upstream version 0.5.5 --- CHANGES.txt | 6 +++++ config.h.in | 16 ++++++++++++++ configure | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- configure.in | 7 ++++-- curl-helper.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++---- curl.ml | 18 +++++++++++++++ curl.mli | 9 ++++++++ 7 files changed, 174 insertions(+), 15 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f020a77..4e9aa5c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,9 @@ +0.5.5 - 23 Feb 2013 + + + CURLINFO_LOCAL_IP CURLINFO_LOCAL_PORT + + pause + + compatibility fixes for old libcurl versions + 0.5.4 - 29 Jan 2013 Makefile: add release target diff --git a/config.h.in b/config.h.in index 3812db7..b52e628 100644 --- a/config.h.in +++ b/config.h.in @@ -368,6 +368,14 @@ if you don't. */ #undef HAVE_DECL_CURLINFO_LASTSOCKET +/* Define to 1 if you have the declaration of `CURLINFO_LOCAL_IP', and to 0 if + you don't. */ +#undef HAVE_DECL_CURLINFO_LOCAL_IP + +/* Define to 1 if you have the declaration of `CURLINFO_LOCAL_PORT', and to 0 + if you don't. */ +#undef HAVE_DECL_CURLINFO_LOCAL_PORT + /* Define to 1 if you have the declaration of `CURLINFO_NAMELOOKUP_TIME', and to 0 if you don't. */ #undef HAVE_DECL_CURLINFO_NAMELOOKUP_TIME @@ -1028,6 +1036,14 @@ you don't. */ #undef HAVE_DECL_CURLOPT_WRITEINFO +/* Define to 1 if you have the declaration of `CURL_VERSION_NTLM_WB', and to 0 + if you don't. */ +#undef HAVE_DECL_CURL_VERSION_NTLM_WB + +/* Define to 1 if you have the declaration of `CURL_VERSION_TLSAUTH_SRP', and + to 0 if you don't. */ +#undef HAVE_DECL_CURL_VERSION_TLSAUTH_SRP + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff --git a/configure b/configure index f59e76a..277d500 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ocurl 0.5.4. +# Generated by GNU Autoconf 2.69 for ocurl 0.5.5. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -576,8 +576,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ocurl' PACKAGE_TARNAME='ocurl' -PACKAGE_VERSION='0.5.4' -PACKAGE_STRING='ocurl 0.5.4' +PACKAGE_VERSION='0.5.5' +PACKAGE_STRING='ocurl 0.5.5' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1202,7 +1202,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ocurl 0.5.4 to adapt to many kinds of systems. +\`configure' configures ocurl 0.5.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1263,7 +1263,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ocurl 0.5.4:";; + short | recursive ) echo "Configuration of ocurl 0.5.5:";; esac cat <<\_ACEOF @@ -1342,7 +1342,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ocurl configure 0.5.4 +ocurl configure 0.5.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1443,7 +1443,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ocurl $as_me 0.5.4, which was +It was created by ocurl $as_me 0.5.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -6208,6 +6208,32 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CURLINFO_PRIMARY_IP $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "CURLINFO_LOCAL_IP" "ac_cv_have_decl_CURLINFO_LOCAL_IP" " +#include \"curl/curl.h\" + +" +if test "x$ac_cv_have_decl_CURLINFO_LOCAL_IP" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CURLINFO_LOCAL_IP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "CURLINFO_LOCAL_PORT" "ac_cv_have_decl_CURLINFO_LOCAL_PORT" " +#include \"curl/curl.h\" + +" +if test "x$ac_cv_have_decl_CURLINFO_LOCAL_PORT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CURLINFO_LOCAL_PORT $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "CURLE_UNSUPPORTED_PROTOCOL" "ac_cv_have_decl_CURLE_UNSUPPORTED_PROTOCOL" " #include \"curl/curl.h\" @@ -7248,6 +7274,32 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CURLE_AGAIN $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "CURL_VERSION_TLSAUTH_SRP" "ac_cv_have_decl_CURL_VERSION_TLSAUTH_SRP" " +#include \"curl/curl.h\" + +" +if test "x$ac_cv_have_decl_CURL_VERSION_TLSAUTH_SRP" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CURL_VERSION_TLSAUTH_SRP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "CURL_VERSION_NTLM_WB" "ac_cv_have_decl_CURL_VERSION_NTLM_WB" " +#include \"curl/curl.h\" + +" +if test "x$ac_cv_have_decl_CURL_VERSION_NTLM_WB" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CURL_VERSION_NTLM_WB $ac_have_decl +_ACEOF ac_config_headers="$ac_config_headers config.h" @@ -7761,7 +7813,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ocurl $as_me 0.5.4, which was +This file was extended by ocurl $as_me 0.5.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7823,7 +7875,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ocurl config.status 0.5.4 +ocurl config.status 0.5.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index 70fd522..a8ddb62 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl dnl ocurl autoconf input dnl -AC_INIT(ocurl,0.5.4) +AC_INIT(ocurl,0.5.5) CURLDIR=`curl-config --cflags` CURLFLAGS=`curl-config --libs | cut -d ' ' -f 1` @@ -87,6 +87,7 @@ CURLINFO_PRIVATE, CURLINFO_HTTP_CONNECTCODE, CURLINFO_HTTPAUTH_AVAIL, CURLINFO_PROXYAUTH_AVAIL, CURLINFO_OS_ERRNO, CURLINFO_NUM_CONNECTS, CURLINFO_SSL_ENGINES, CURLINFO_COOKIELIST, CURLINFO_LASTSOCKET, CURLINFO_FTP_ENTRY_PATH, CURLINFO_REDIRECT_URL, CURLINFO_PRIMARY_IP, +CURLINFO_LOCAL_IP, CURLINFO_LOCAL_PORT, CURLE_UNSUPPORTED_PROTOCOL, CURLE_FAILED_INIT, CURLE_URL_MALFORMAT, CURLE_URL_MALFORMAT_USER, CURLE_COULDNT_RESOLVE_PROXY, @@ -116,7 +117,9 @@ CURLE_LOGIN_DENIED, CURLE_TFTP_NOTFOUND, CURLE_TFTP_PERM, CURLE_REMOTE_DISK_FULL, CURLE_TFTP_ILLEGAL, CURLE_TFTP_UNKNOWNID, CURLE_REMOTE_FILE_EXISTS, CURLE_TFTP_NOSUCHUSER, CURLE_CONV_FAILED, CURLE_CONV_REQD, CURLE_SSL_CACERT_BADFILE, CURLE_REMOTE_FILE_NOT_FOUND, -CURLE_SSH, CURLE_SSL_SHUTDOWN_FAILED, CURLE_AGAIN], +CURLE_SSH, CURLE_SSL_SHUTDOWN_FAILED, CURLE_AGAIN, + +CURL_VERSION_TLSAUTH_SRP, CURL_VERSION_NTLM_WB], [], [], [ #include "curl/curl.h" diff --git a/curl-helper.c b/curl-helper.c index ef119f0..b4be014 100644 --- a/curl-helper.c +++ b/curl-helper.c @@ -1786,7 +1786,7 @@ static curlioerr ioctlFunction(CURL *ioctl, return r; } -#ifdef HAVE_DECL_CURLOPT_SEEKFUNCTION +#if HAVE_DECL_CURLOPT_SEEKFUNCTION static int seekFunction_nolock(void *data, curl_off_t offset, int origin) @@ -1830,7 +1830,7 @@ static int seekFunction(void *data, #endif -#ifdef HAVE_DECL_CURLOPT_OPENSOCKETFUNCTION +#if HAVE_DECL_CURLOPT_OPENSOCKETFUNCTION static int openSocketFunction_nolock(void *data, curlsocktype purpose, struct curl_sockaddr *addr) @@ -5437,7 +5437,7 @@ static void handleRedirProtocols(Connection *conn, value option) } #endif -#ifdef HAVE_DECL_CURLOPT_RESOLVE +#if HAVE_DECL_CURLOPT_RESOLVE static void handleResolve(Connection *conn, value option) { CAMLparam1(option); @@ -5475,7 +5475,7 @@ static void handleResolve(Connection *conn, value option) } #endif -#ifdef HAVE_DECL_CURLOPT_DNS_SERVERS +#if HAVE_DECL_CURLOPT_DNS_SERVERS static void handleDnsServers(Connection *conn, value option) { CAMLparam1(option); @@ -5992,6 +5992,30 @@ CAMLprim value helper_curl_easy_getinfo(value conn, value option) #warning "libcurl does not provide CURLINFO_PRIMARY_IP" #endif +#if HAVE_DECL_CURLINFO_LOCAL_IP + case 33: /* CURLINFO_LOCAL_IP */ + resultType = StringValue; + + curlResult = curl_easy_getinfo(connection->connection, + CURLINFO_LOCAL_IP, + &strValue); + break; +#else +#warning "libcurl does not provide CURLINFO_LOCAL_IP" +#endif + +#if HAVE_DECL_CURLINFO_LOCAL_PORT + case 34: /* CURLINFO_LOCAL_PORT */ + resultType = LongValue; + + curlResult = curl_easy_getinfo(connection->connection, + CURLINFO_LOCAL_PORT, + &longValue); + break; +#else +#warning "libcurl does not provide CURLINFO_LOCAL_PORT" +#endif + default: failwith("Invalid CURLINFO Option"); break; @@ -6116,8 +6140,12 @@ struct CURLVersionBitsMapping versionBitsMap[] = {CURL_VERSION_IDN, "idn"}, {CURL_VERSION_SSPI, "sspi"}, {CURL_VERSION_CONV, "conv"}, +#if HAVE_DECL_CURL_VERSION_TLSAUTH_SRP {CURL_VERSION_TLSAUTH_SRP, "srp"}, +#endif +#if HAVE_DECL_CURL_VERSION_NTLM_WB {CURL_VERSION_NTLM_WB, "wb"}, +#endif }; CAMLprim value caml_curl_version_info(value unit) @@ -6165,6 +6193,33 @@ CAMLprim value caml_curl_version_info(value unit) CAMLreturn(v); } +CAMLprim value caml_curl_pause(value conn, value opts) +{ + CAMLparam2(conn, opts); + CAMLlocal4(v, vlist, vnum, vfeatures); + Connection *connection = Connection_val(conn); + int bitmask = 0; + CURLcode result; + + while (Val_emptylist != opts) + { + switch (Int_val(Field(opts,0))) + { + case 0: bitmask |= CURLPAUSE_SEND; break; + case 1: bitmask |= CURLPAUSE_RECV; break; + case 2: bitmask |= CURLPAUSE_ALL; break; + default: caml_failwith("wrong pauseOption"); + } + opts = Field(opts,1); + } + + result = curl_easy_pause(connection->connection,bitmask); + if (result != CURLE_OK) + raiseError(connection, result); + + CAMLreturn(Val_unit); +} + /* * Curl multi stack support * diff --git a/curl.ml b/curl.ml index c2d5e77..19e71c3 100644 --- a/curl.ml +++ b/curl.ml @@ -429,6 +429,8 @@ type curlInfo = | CURLINFO_FTP_ENTRY_PATH | CURLINFO_REDIRECT_URL | CURLINFO_PRIMARY_IP + | CURLINFO_LOCAL_IP + | CURLINFO_LOCAL_PORT type curlInfoResult = | CURLINFO_String of string @@ -507,6 +509,10 @@ external version_info : unit -> version_info = "caml_curl_version_info" external strerror : curlCode -> string = "helper_curl_easy_strerror" let errno : curlCode -> int = Obj.magic +type pauseOption = PAUSE_SEND | PAUSE_RECV | PAUSE_ALL + +external pause : t -> pauseOption list -> unit = "caml_curl_pause" + let set_writefunction conn closure = setopt conn (CURLOPT_WRITEFUNCTION closure) @@ -1076,6 +1082,16 @@ let get_primaryip conn = | CURLINFO_String s -> s | _ -> "" +let get_localip conn = + match (getinfo conn CURLINFO_LOCAL_IP) with + | CURLINFO_String s -> s + | _ -> "" + +let get_localport conn = + match (getinfo conn CURLINFO_LOCAL_PORT) with + | CURLINFO_Long n -> n + | _ -> 0 + let () = Callback.register_exception "CurlException" (CurlException (CURLE_OK, 0, "")) @@ -1250,6 +1266,8 @@ class handle = method get_lastsocket = get_lastsocket conn method get_ftpentrypath = get_ftpentrypath conn method get_primaryip = get_primaryip conn + method get_localip = get_localip conn + method get_localport = get_localport conn end module Multi = struct diff --git a/curl.mli b/curl.mli index 7504170..3884396 100644 --- a/curl.mli +++ b/curl.mli @@ -433,6 +433,8 @@ type curlInfo = | CURLINFO_FTP_ENTRY_PATH | CURLINFO_REDIRECT_URL | CURLINFO_PRIMARY_IP + | CURLINFO_LOCAL_IP (** @since 7.21.0 *) + | CURLINFO_LOCAL_PORT (** @since 7.21.0 *) type curlInfoResult = | CURLINFO_String of string @@ -455,6 +457,8 @@ type version_info = { libssh_version : string; } +type pauseOption = PAUSE_SEND | PAUSE_RECV | PAUSE_ALL + val global_init : initOption -> unit val global_cleanup : unit -> unit val init : unit -> t @@ -472,6 +476,7 @@ val version : unit -> string val strerror : curlCode -> string val errno : curlCode -> int val version_info : unit -> version_info +val pause : t -> pauseOption list -> unit val set_writefunction : t -> (string -> int) -> unit val set_readfunction : t -> (int -> string) -> unit @@ -644,6 +649,8 @@ val get_cookielist : t -> string list val get_lastsocket : t -> int val get_ftpentrypath : t -> string val get_primaryip : t -> string +val get_localip : t -> string +val get_localport : t -> int class handle : object ('a) @@ -816,6 +823,8 @@ class handle : method get_lastsocket : int method get_ftpentrypath : string method get_primaryip : string + method get_localip : string + method get_localport : int end (** Curl multi stack. Functions may raise [Failure] on critical errors *) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ocurl.git _______________________________________________ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits