Skip to content

Commit

Permalink
Merge pull request taf2#260 from egwspiti/unix-socket
Browse files Browse the repository at this point in the history
Support CURLOPT_UNIX_SOCKET_PATH in Curl::Easy
  • Loading branch information
taf2 committed Oct 14, 2015
2 parents b085859 + 9afc7f7 commit bd1f34e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/curb.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,10 @@ void Init_curb_core() {
CURB_DEFINE(CURLGSSAPI_DELEGATION_POLICY_FLAG);
#endif

#if HAVE_CURLOPT_UNIX_SOCKET_PATH
CURB_DEFINE(CURLOPT_UNIX_SOCKET_PATH);
#endif

#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
rb_define_const(mCurl, "HTTP_2_0", LONG2NUM(CURL_HTTP_VERSION_2_0));
#endif
Expand Down
3 changes: 3 additions & 0 deletions ext/curb_easy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3180,6 +3180,9 @@ static VALUE ruby_curl_easy_set_opt(VALUE self, VALUE opt, VALUE val) {
curl_easy_setopt(rbce->curl, CURLOPT_GSSAPI_DELEGATION, FIX2LONG(val));
} break;
#endif
case CURLOPT_UNIX_SOCKET_PATH: {
curl_easy_setopt(rbce->curl, CURLOPT_UNIX_SOCKET_PATH, StringValueCStr(val));
} break;
default:
rb_raise(rb_eTypeError, "Curb unsupported option");
}
Expand Down
3 changes: 3 additions & 0 deletions ext/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ def have_constant(name)

have_constant "CURLM_ADDED_ALREADY"

# added in 7.40.0
have_constant "curlopt_unix_socket_path"

if try_compile('int main() { return 0; }','-Wall')
$CFLAGS << ' -Wall'
end
Expand Down

0 comments on commit bd1f34e

Please sign in to comment.