Module | Ethon::Curl |
In: |
lib/ethon/curls/constants.rb
lib/ethon/curls/settings.rb lib/ethon/curls/classes.rb lib/ethon/curl.rb |
FFI Wrapper module for Curl. Holds constants and required initializers.
@api private
VERSION_NOW | = | 3 | :nodoc: | |
GLOBAL_SSL | = | 0x01 | Flag. Initialize SSL. | |
GLOBAL_WIN32 | = | 0x02 | Flag. Initialize win32 socket libraries. | |
GLOBAL_ALL | = | (GLOBAL_SSL | GLOBAL_WIN32) | Flag. Initialize everything possible. | |
GLOBAL_DEFAULT | = | GLOBAL_ALL | Flag. Initialize everything by default. | |
EasyCode | = | enum(:easy_code, easy_codes) | :nodoc: | |
MultiCode | = | enum(:multi_code, multi_codes) | :nodoc: | |
EasyOption | = | enum(:easy_option, easy_options(:enum).to_a.flatten) | :nodoc: | |
MultiOption | = | enum(:multi_option, multi_options(:enum).to_a.flatten) | :nodoc: | |
DebugInfoType | = | enum(:debug_info_type, debug_info_types) | Used by curl_debug_callback when setting CURLOPT_DEBUGFUNCTION github.com/bagder/curl/blob/master/include/curl/curl.h#L378 for details | |
InfoType | = | enum(info_types.to_a.flatten) | :nodoc: | |
Info | = | enum(:info, infos.to_a.flatten) | Info details, refer github.com/bagder/curl/blob/master/src/tool_writeout.c#L66 for details | |
FormOption | = | enum(:form_option, form_options) | Form options, used by FormAdd for temporary storage, refer github.com/bagder/curl/blob/master/lib/formdata.h#L51 for details | |
MsgCode | = | enum(:msg_code, msg_codes) | :nodoc: | |
VERSION_IPV6 | = | (1<<0) | ||
VERSION_KERBEROS4 | = | (1<<1) | ||
VERSION_SSL | = | (1<<2) | ||
VERSION_LIBZ | = | (1<<3) | ||
VERSION_NTLM | = | (1<<4) | ||
VERSION_GSSNEGOTIATE | = | (1<<5) | ||
VERSION_DEBUG | = | (1<<6) | ||
VERSION_ASYNCHDNS | = | (1<<7) | ||
VERSION_SPNEGO | = | (1<<8) | ||
VERSION_LARGEFILE | = | (1<<9) | ||
VERSION_IDN | = | (1<<10) | ||
VERSION_SSPI | = | (1<<11) | ||
VERSION_CONV | = | (1<<12) | ||
VERSION_CURLDEBUG | = | (1<<13) | ||
VERSION_TLSAUTH_SRP | = | (1<<14) | ||
VERSION_NTLM_WB | = | (1<<15) | ||
VERSION_HTTP2 | = | (1<<16) | ||
VERSION_GSSAPI | = | (1<<17) |
This function releases resources acquired by curl_global_init. You should call curl_global_cleanup once for each call you make to curl_global_init, after you are done using libcurl. This function is not thread safe. You must not call it when any other thread in the program (i.e. a thread sharing the same memory) is running. This doesn‘t just mean no other thread that is using libcurl. Because curl_global_cleanup calls functions of other libraries that are similarly thread unsafe, it could conflict with any other thread that uses these other libraries. See the description in libcurl of global environment requirements for details of how to use this function.
This function sets up the program environment that libcurl needs. Think of it as an extension of the library loader.
This function must be called at least once within a program (a program is all the code that shares a memory space) before the program calls any other function in libcurl. The environment it sets up is constant for the life of the program and is the same for every program, so multiple calls have the same effect as one call.
The flags option is a bit pattern that tells libcurl exactly what features to init, as described below. Set the desired bits by ORing the values together. In normal operation, you must specify CURL_GLOBAL_ALL. Don‘t use any other value unless you are familiar with it and mean to control internal operations of libcurl.
This function is not thread safe. You must not call it when any other thread in the program (i.e. a thread sharing the same memory) is running. This doesn‘t just mean no other thread that is using libcurl. Because curl_global_init() calls functions of other libraries that are similarly thread unsafe, it could conflict with any other thread that uses these other libraries.
@raise [ Ethon::Errors::GlobalInit ] If Curl.global_init fails.