ethon 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +41 -0
  3. data/CHANGELOG.md +3 -0
  4. data/Gemfile +5 -0
  5. data/Guardfile +1 -0
  6. data/README.md +1 -1
  7. data/Rakefile +1 -0
  8. data/ethon.gemspec +2 -1
  9. data/lib/ethon.rb +1 -0
  10. data/lib/ethon/curl.rb +1 -0
  11. data/lib/ethon/curls/classes.rb +1 -0
  12. data/lib/ethon/curls/codes.rb +1 -1
  13. data/lib/ethon/curls/constants.rb +1 -0
  14. data/lib/ethon/curls/form_options.rb +1 -0
  15. data/lib/ethon/curls/functions.rb +4 -13
  16. data/lib/ethon/curls/infos.rb +4 -3
  17. data/lib/ethon/curls/messages.rb +1 -0
  18. data/lib/ethon/curls/options.rb +25 -22
  19. data/lib/ethon/curls/settings.rb +1 -0
  20. data/lib/ethon/easy.rb +1 -1
  21. data/lib/ethon/easy/callbacks.rb +4 -3
  22. data/lib/ethon/easy/debug_info.rb +1 -0
  23. data/lib/ethon/easy/features.rb +1 -0
  24. data/lib/ethon/easy/form.rb +1 -0
  25. data/lib/ethon/easy/header.rb +1 -0
  26. data/lib/ethon/easy/http.rb +1 -0
  27. data/lib/ethon/easy/http/actionable.rb +1 -0
  28. data/lib/ethon/easy/http/custom.rb +1 -0
  29. data/lib/ethon/easy/http/delete.rb +1 -0
  30. data/lib/ethon/easy/http/get.rb +1 -0
  31. data/lib/ethon/easy/http/head.rb +1 -0
  32. data/lib/ethon/easy/http/options.rb +1 -0
  33. data/lib/ethon/easy/http/patch.rb +1 -0
  34. data/lib/ethon/easy/http/post.rb +1 -0
  35. data/lib/ethon/easy/http/postable.rb +1 -0
  36. data/lib/ethon/easy/http/put.rb +1 -0
  37. data/lib/ethon/easy/http/putable.rb +1 -0
  38. data/lib/ethon/easy/informations.rb +1 -0
  39. data/lib/ethon/easy/mirror.rb +1 -0
  40. data/lib/ethon/easy/operations.rb +16 -1
  41. data/lib/ethon/easy/options.rb +1 -0
  42. data/lib/ethon/easy/params.rb +1 -0
  43. data/lib/ethon/easy/queryable.rb +1 -0
  44. data/lib/ethon/easy/response_callbacks.rb +1 -0
  45. data/lib/ethon/easy/util.rb +1 -0
  46. data/lib/ethon/errors.rb +1 -0
  47. data/lib/ethon/errors/ethon_error.rb +1 -0
  48. data/lib/ethon/errors/global_init.rb +1 -0
  49. data/lib/ethon/errors/invalid_option.rb +1 -0
  50. data/lib/ethon/errors/invalid_value.rb +1 -0
  51. data/lib/ethon/errors/multi_add.rb +1 -0
  52. data/lib/ethon/errors/multi_fdset.rb +1 -0
  53. data/lib/ethon/errors/multi_remove.rb +1 -0
  54. data/lib/ethon/errors/multi_timeout.rb +1 -0
  55. data/lib/ethon/errors/select.rb +1 -0
  56. data/lib/ethon/libc.rb +1 -0
  57. data/lib/ethon/loggable.rb +1 -0
  58. data/lib/ethon/multi.rb +1 -0
  59. data/lib/ethon/multi/operations.rb +1 -0
  60. data/lib/ethon/multi/options.rb +8 -7
  61. data/lib/ethon/multi/stack.rb +1 -0
  62. data/lib/ethon/version.rb +2 -1
  63. data/profile/benchmarks.rb +1 -0
  64. data/profile/memory_leaks.rb +1 -0
  65. data/profile/perf_spec_helper.rb +1 -0
  66. data/profile/support/memory_test_helpers.rb +1 -0
  67. data/profile/support/os_memory_leak_tracker.rb +1 -0
  68. data/profile/support/ruby_object_leak_tracker.rb +1 -0
  69. data/spec/ethon/curl_spec.rb +1 -0
  70. data/spec/ethon/easy/callbacks_spec.rb +1 -0
  71. data/spec/ethon/easy/debug_info_spec.rb +1 -0
  72. data/spec/ethon/easy/features_spec.rb +1 -0
  73. data/spec/ethon/easy/form_spec.rb +1 -0
  74. data/spec/ethon/easy/header_spec.rb +1 -0
  75. data/spec/ethon/easy/http/custom_spec.rb +1 -0
  76. data/spec/ethon/easy/http/delete_spec.rb +1 -0
  77. data/spec/ethon/easy/http/get_spec.rb +1 -0
  78. data/spec/ethon/easy/http/head_spec.rb +1 -0
  79. data/spec/ethon/easy/http/options_spec.rb +1 -0
  80. data/spec/ethon/easy/http/patch_spec.rb +1 -0
  81. data/spec/ethon/easy/http/post_spec.rb +1 -0
  82. data/spec/ethon/easy/http/put_spec.rb +1 -0
  83. data/spec/ethon/easy/http_spec.rb +1 -0
  84. data/spec/ethon/easy/informations_spec.rb +1 -0
  85. data/spec/ethon/easy/mirror_spec.rb +1 -0
  86. data/spec/ethon/easy/operations_spec.rb +1 -0
  87. data/spec/ethon/easy/options_spec.rb +2 -1
  88. data/spec/ethon/easy/queryable_spec.rb +1 -0
  89. data/spec/ethon/easy/response_callbacks_spec.rb +1 -0
  90. data/spec/ethon/easy/util_spec.rb +1 -0
  91. data/spec/ethon/easy_spec.rb +3 -2
  92. data/spec/ethon/libc_spec.rb +1 -0
  93. data/spec/ethon/loggable_spec.rb +1 -0
  94. data/spec/ethon/multi/operations_spec.rb +1 -0
  95. data/spec/ethon/multi/options_spec.rb +1 -0
  96. data/spec/ethon/multi/stack_spec.rb +1 -0
  97. data/spec/ethon/multi_spec.rb +1 -0
  98. data/spec/spec_helper.rb +1 -0
  99. data/spec/support/localhost_server.rb +2 -1
  100. data/spec/support/server.rb +1 -0
  101. metadata +6 -7
  102. data/.travis.yml +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d849b2843c88fd4277aac9caa8b9e50b93ec7d3cf7805c4eb3c06dcfb6ee9959
4
- data.tar.gz: 61b75662bc26c23ce525eb7b98ea2404308d3cd1c6912e92b7acbedabaf95944
3
+ metadata.gz: 87e1825a32b82c558aded416768e7dffc8a1be6918bca888187b343e17159432
4
+ data.tar.gz: 4773483d3d4e5bf46298d55c4d4967622666bf28f6665445d621ab2b4de30213
5
5
  SHA512:
6
- metadata.gz: c586fb2b19fa35183ee81aaa685ddae7cbebbe55c80166dc20256f6d14181cfc15fe31f88b8951f474d05be77246201c24a8b27dc92a10c0ac177842f4d4c522
7
- data.tar.gz: ef4b60756f41c27873cc8c4e7d7ab1d140ec24b6940dedcafc2920d7d7fa5d11e06a437e39c38742b4ac2e7041ad89f1b49f68566b5b90063cbf581b0efc78b2
6
+ metadata.gz: bc51f162c86e89ddc1176368a508870e0be217a11027ae17d93149cbc04ae822d2d03ce6e2fa0e15269bbafefbda9e2dbfd1e64aba0b4e3fddbf820b958a3b82
7
+ data.tar.gz: 8c755c396544992d6062fe28f3a7a741c3269941665e89995a5f5060d08b4ed8d4f5768bc0601efa7780b1407c49d1839e4557f3ac591abc0529438ad8506163
@@ -0,0 +1,41 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ${{ matrix.os }}-latest
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os: [ubuntu, macos]
23
+ ruby-version: [2.5, 2.6, 2.7, 3.0, head, debug, truffleruby, truffleruby-head]
24
+ continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ - name: Install libcurl header
28
+ run: |
29
+ if ${{ matrix.os == 'macos' }}
30
+ then
31
+ brew install curl
32
+ else
33
+ sudo apt install -y libcurl4-openssl-dev
34
+ fi
35
+ - name: Set up Ruby
36
+ uses: ruby/setup-ruby@v1
37
+ with:
38
+ ruby-version: ${{ matrix.ruby-version }}
39
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
40
+ - name: Run tests
41
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -8,6 +8,9 @@
8
8
 
9
9
  [Full Changelog](https://github.com/typhoeus/ethon/compare/v0.11.0...v0.12.0)
10
10
 
11
+ - Removed deprecated `CURLE_SSL_CACERT` pinned in curl v7.62.0 ([@arku](https://github.com/arku) in [#158](https://github.com/typhoeus/ethon/pull/158))
12
+
13
+
11
14
  ## 0.11.0
12
15
 
13
16
  [Full Changelog](https://github.com/typhoeus/ethon/compare/v0.10.1...v0.11.0)
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  source "https://rubygems.org"
2
3
  gemspec
3
4
 
@@ -29,6 +30,10 @@ group :development, :test do
29
30
  elsif Gem.ruby_version >= Gem::Version.new("2.0.0")
30
31
  gem "mustermann", "0.3.1"
31
32
  end
33
+
34
+ if Gem.ruby_version >= Gem::Version.new("3.0.0")
35
+ gem "webrick"
36
+ end
32
37
  end
33
38
 
34
39
  group :perf do
data/Guardfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # vim:set filetype=ruby:
2
3
  guard(
3
4
  "rspec",
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/ethon.svg)](https://badge.fury.io/rb/ethon)
2
- [![Build Status](https://travis-ci.org/typhoeus/ethon.svg?branch=master)](https://travis-ci.org/typhoeus/ethon)
2
+ [![Build Status](https://github.com/typhoeus/ethon/workflows/Ruby/badge.svg)](https://github.com/typhoeus/ethon/actions/workflows/ruby.yml)
3
3
 
4
4
  # Ethon
5
5
 
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "bundler"
2
3
  Bundler.setup
3
4
 
data/ethon.gemspec CHANGED
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  lib = File.expand_path('../lib/', __FILE__)
3
4
  $:.unshift lib unless $:.include?(lib)
4
5
 
@@ -17,7 +18,7 @@ Gem::Specification.new do |s|
17
18
  s.required_rubygems_version = ">= 1.3.6"
18
19
  s.license = 'MIT'
19
20
 
20
- s.add_dependency('ffi', ['>= 1.3.0'])
21
+ s.add_dependency('ffi', ['>= 1.15.0'])
21
22
 
22
23
  s.files = `git ls-files`.split("\n")
23
24
  s.test_files = `git ls-files -- spec/*`.split("\n")
data/lib/ethon.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'logger'
2
3
  require 'ffi'
3
4
  require 'thread'
data/lib/ethon/curl.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'ethon/curls/codes'
2
3
  require 'ethon/curls/options'
3
4
  require 'ethon/curls/infos'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curl
3
4
  # :nodoc:
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curls # :nodoc:
3
4
 
@@ -69,7 +70,6 @@ module Ethon
69
70
  :obsolete57,
70
71
  :ssl_certproblem,
71
72
  :ssl_cipher,
72
- :ssl_cacert,
73
73
  :bad_content_encoding,
74
74
  :ldap_invalid_url,
75
75
  :filesize_exceeded,
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curl
3
4
  # :nodoc:
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curls
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curls
3
4
 
@@ -13,14 +14,8 @@ module Ethon
13
14
 
14
15
  base.attach_function :easy_init, :curl_easy_init, [], :pointer
15
16
  base.attach_function :easy_cleanup, :curl_easy_cleanup, [:pointer], :void
16
- base.attach_function :easy_getinfo, :curl_easy_getinfo, [:pointer, :info, :pointer], :easy_code
17
- base.attach_function :easy_setopt_ffipointer, :curl_easy_setopt, [:pointer, :easy_option, :pointer], :easy_code
18
- base.attach_function :easy_setopt_string, :curl_easy_setopt, [:pointer, :easy_option, :string], :easy_code
19
- base.attach_function :easy_setopt_long, :curl_easy_setopt, [:pointer, :easy_option, :long], :easy_code
20
- base.attach_function :easy_setopt_callback, :curl_easy_setopt, [:pointer, :easy_option, :callback], :easy_code
21
- base.attach_function :easy_setopt_debug_callback, :curl_easy_setopt, [:pointer, :easy_option, :debug_callback], :easy_code
22
- base.attach_function :easy_setopt_progress_callback, :curl_easy_setopt, [:pointer, :easy_option, :progress_callback], :easy_code
23
- base.attach_function :easy_setopt_off_t, :curl_easy_setopt, [:pointer, :easy_option, :int64], :easy_code
17
+ base.attach_function :easy_getinfo, :curl_easy_getinfo, [:pointer, :info, :varargs], :easy_code
18
+ base.attach_function :easy_setopt, :curl_easy_setopt, [:pointer, :easy_option, :varargs], :easy_code
24
19
  base.instance_variable_set(:@blocking, true)
25
20
  base.attach_function :easy_perform, :curl_easy_perform, [:pointer], :easy_code
26
21
  base.attach_function :easy_strerror, :curl_easy_strerror, [:easy_code], :string
@@ -40,11 +35,7 @@ module Ethon
40
35
  base.attach_function :multi_timeout, :curl_multi_timeout, [:pointer, :pointer], :multi_code
41
36
  base.attach_function :multi_fdset, :curl_multi_fdset, [:pointer, Curl::FDSet.ptr, Curl::FDSet.ptr, Curl::FDSet.ptr, :pointer], :multi_code
42
37
  base.attach_function :multi_strerror, :curl_multi_strerror, [:int], :string
43
- base.attach_function :multi_setopt_ffipointer, :curl_multi_setopt, [:pointer, :multi_option, :pointer], :multi_code
44
- base.attach_function :multi_setopt_string, :curl_multi_setopt, [:pointer, :multi_option, :string], :multi_code
45
- base.attach_function :multi_setopt_long, :curl_multi_setopt, [:pointer, :multi_option, :long], :multi_code
46
- base.attach_function :multi_setopt_callback, :curl_multi_setopt, [:pointer, :multi_option, :callback], :multi_code
47
- base.attach_function :multi_setopt_off_t, :curl_multi_setopt, [:pointer, :multi_option, :int64], :multi_code
38
+ base.attach_function :multi_setopt, :curl_multi_setopt, [:pointer, :multi_option, :varargs], :multi_code
48
39
 
49
40
  base.attach_function :version, :curl_version, [], :string
50
41
  base.attach_function :version_info, :curl_version_info, [], Curl::VersionInfoData.ptr
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curls
3
4
 
@@ -106,7 +107,7 @@ module Ethon
106
107
  def get_info_string(option, handle)
107
108
  string_ptr = ::FFI::MemoryPointer.new(:pointer)
108
109
 
109
- if easy_getinfo(handle, option, string_ptr) == :ok
110
+ if easy_getinfo(handle, option, :pointer, string_ptr) == :ok
110
111
  ptr=string_ptr.read_pointer
111
112
  ptr.null? ? nil : ptr.read_string
112
113
  end
@@ -124,7 +125,7 @@ module Ethon
124
125
  def get_info_long(option, handle)
125
126
  long_ptr = ::FFI::MemoryPointer.new(:long)
126
127
 
127
- if easy_getinfo(handle, option, long_ptr) == :ok
128
+ if easy_getinfo(handle, option, :pointer, long_ptr) == :ok
128
129
  long_ptr.read_long
129
130
  end
130
131
  end
@@ -141,7 +142,7 @@ module Ethon
141
142
  def get_info_double(option, handle)
142
143
  double_ptr = ::FFI::MemoryPointer.new(:double)
143
144
 
144
- if easy_getinfo(handle, option, double_ptr) == :ok
145
+ if easy_getinfo(handle, option, :pointer, double_ptr) == :ok
145
146
  double_ptr.read_double
146
147
  end
147
148
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curls
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curls
3
4
 
@@ -7,8 +8,7 @@ module Ethon
7
8
 
8
9
  OPTION_STRINGS = { :easy => 'easy_options', :multi => 'multi_options' }.freeze
9
10
  FOPTION_STRINGS = { :easy => 'EASY_OPTIONS', :multi => 'MULTI_OPTIONS' }.freeze
10
- FTYPES = [:long, :string, :ffipointer, :callback, :debug_callback, :progress_callback, :off_t]
11
- FUNCS = Hash[*[:easy, :multi].zip([:easy, :multi].map { |t| Hash[*FTYPES.zip(FTYPES.map { |ft| "#{t}_setopt_#{ft}" }).flatten] }).flatten]
11
+ FUNCS = { :easy => 'easy_setopt', :multi => 'multi_setopt' }.freeze
12
12
  # Sets appropriate option for easy, depending on value type.
13
13
  def set_option(option, value, handle, type = :easy)
14
14
  type = type.to_sym unless type.is_a?(Symbol)
@@ -20,22 +20,22 @@ module Ethon
20
20
  when :none
21
21
  return if value.nil?
22
22
  value=1
23
- func=:long
23
+ va_type=:long
24
24
  when :int
25
25
  return if value.nil?
26
- func=:long
26
+ va_type=:long
27
27
  value=value.to_i
28
28
  when :bool
29
29
  return if value.nil?
30
- func=:long
30
+ va_type=:long
31
31
  value=(value&&value!=0) ? 1 : 0
32
32
  when :time
33
33
  return if value.nil?
34
- func=:long
34
+ va_type=:long
35
35
  value=value.to_i
36
36
  when :enum
37
37
  return if value.nil?
38
- func=:long
38
+ va_type=:long
39
39
  value = case value
40
40
  when Symbol
41
41
  opthash[option][:opts][value]
@@ -46,7 +46,7 @@ module Ethon
46
46
  end.to_i
47
47
  when :bitmask
48
48
  return if value.nil?
49
- func=:long
49
+ va_type=:long
50
50
  value = case value
51
51
  when Symbol
52
52
  opthash[option][:opts][value]
@@ -56,22 +56,22 @@ module Ethon
56
56
  value
57
57
  end.to_i
58
58
  when :string
59
- func=:string
59
+ va_type=:string
60
60
  value=value.to_s unless value.nil?
61
61
  when :string_as_pointer
62
- func = :ffipointer
62
+ va_type = :pointer
63
63
  s = ''
64
64
  s = value.to_s unless value.nil?
65
65
  value = FFI::MemoryPointer.new(:char, s.bytesize)
66
66
  value.put_bytes(0, s)
67
67
  when :string_escape_null
68
- func=:string
68
+ va_type=:string
69
69
  value=Util.escape_zero_byte(value) unless value.nil?
70
70
  when :ffipointer
71
- func=:ffipointer
71
+ va_type=:pointer
72
72
  raise Errors::InvalidValue.new(option,value) unless value.nil? or value.is_a? FFI::Pointer
73
73
  when :curl_slist
74
- func=:ffipointer
74
+ va_type=:pointer
75
75
  raise Errors::InvalidValue.new(option,value) unless value.nil? or value.is_a? FFI::Pointer
76
76
  when :buffer
77
77
  raise NotImplementedError, "Ethon::Curls::Options option #{option} buffer type not implemented."
@@ -80,27 +80,26 @@ module Ethon
80
80
  when :cbdata
81
81
  raise NotImplementedError, "Ethon::Curls::Options option #{option} callback data type not implemented. Use Ruby closures."
82
82
  when :callback
83
- func=:callback
83
+ va_type=:callback
84
84
  raise Errors::InvalidValue.new(option,value) unless value.nil? or value.is_a? Proc
85
85
  when :debug_callback
86
- func=:debug_callback
86
+ va_type=:debug_callback
87
87
  raise Errors::InvalidValue.new(option,value) unless value.nil? or value.is_a? Proc
88
88
  when :progress_callback
89
- func=:progress_callback
89
+ va_type=:progress_callback
90
90
  raise Errors::InvalidValue.new(option,value) unless value.nil? or value.is_a? Proc
91
91
  when :off_t
92
92
  return if value.nil?
93
- func=:off_t
93
+ va_type=:int64
94
94
  value=value.to_i
95
95
  end
96
96
 
97
- if func==:long or func==:off_t then
98
- bits=FFI.type_size(:long)*8 if func==:long
99
- bits=FFI.type_size(:int64)*8 if func==:off_t
97
+ if va_type==:long or va_type==:int64 then
98
+ bits=FFI.type_size(va_type)*8
100
99
  tv=((value<0) ? value.abs-1 : value)
101
100
  raise Errors::InvalidValue.new(option,value) unless tv<(1<<bits)
102
101
  end
103
- send(FUNCS[type][func], handle, opthash[option][:opt], value)
102
+ send(FUNCS[type], handle, opthash[option][:opt], va_type, value)
104
103
  end
105
104
 
106
105
  OPTION_TYPE_BASE = {
@@ -251,6 +250,7 @@ module Ethon
251
250
  option :easy, :opensocketdata, :cbdata, 164
252
251
  option :easy, :closesocketfunction, :callback, 208
253
252
  option :easy, :closesocketdata, :cbdata, 209
253
+ option :easy, :path_as_is, :bool, 234
254
254
  option :easy, :progressfunction, :progress_callback, 56
255
255
  option :easy, :progressdata, :cbdata, 57
256
256
  option :easy, :headerfunction, :callback, 79
@@ -282,7 +282,7 @@ module Ethon
282
282
  option :easy, :redir_protocols, :bitmask, 182, [nil, :http, :https, :ftp, :ftps, :scp, :sftp, :telnet, :ldap, :ldaps, :dict, :file, :tftp, :imap, :imaps, :pop3, :pop3s, :smtp, :smtps, :rtsp, :rtmp, :rtmpt, :rtmpe, :rtmpte, :rtmps, :rtmpts, :gopher]
283
283
  option :easy, :proxy, :string, 4
284
284
  option :easy, :proxyport, :int, 59
285
- option :easy, :proxytype, :enum, 101, [:http, :http_1_0, nil, nil, :socks4, :socks5, :socks4a, :socks5_hostname]
285
+ option :easy, :proxytype, :enum, 101, [:http, :http_1_0, :https, nil, :socks4, :socks5, :socks4a, :socks5_hostname]
286
286
  option :easy, :noproxy, :string, 177
287
287
  option :easy, :httpproxytunnel, :bool, 61
288
288
  option :easy, :socks5_gssapi_service, :string, 179
@@ -294,6 +294,7 @@ module Ethon
294
294
  option :easy, :dns_use_global_cache, :bool, 91 # Obsolete
295
295
  option :easy, :dns_interface, :string, 221
296
296
  option :easy, :dns_local_ip4, :string, 222
297
+ option :easy, :dns_shuffle_addresses, :bool, 275
297
298
  option :easy, :buffersize, :int, 98
298
299
  option :easy, :port, :int, 3
299
300
  option :easy, :tcp_nodelay, :bool, 121
@@ -447,6 +448,8 @@ module Ethon
447
448
  option :easy, :krblevel, :string, 63
448
449
  option_alias :easy, :krblevel, :krb4level
449
450
  option :easy, :gssapi_delegation, :bitmask, 210, [:none, :policy_flag, :flag]
451
+ option :easy, :pinnedpublickey, :string, 230
452
+ option_alias :easy, :pinnedpublickey, :pinned_public_key
450
453
  ## SSH OPTIONS
451
454
  option :easy, :ssh_auth_types, :bitmask, 151, [:none, :publickey, :password, :host, :keyboard, :agent, {:any => [:all], :default => [:any]}]
452
455
  option :easy, :ssh_host_public_key_md5, :string, 162
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  module Curl
3
4
  callback :callback, [:pointer, :size_t, :size_t, :pointer], :size_t
data/lib/ethon/easy.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'ethon/easy/informations'
2
3
  require 'ethon/easy/features'
3
4
  require 'ethon/easy/callbacks'
@@ -159,7 +160,6 @@ module Ethon
159
160
  # * :recv_error: Failure with receiving network data.
160
161
  # * :ssl_certproblem: problem with the local client certificate.
161
162
  # * :ssl_cipher: Couldn't use specified cipher.
162
- # * :ssl_cacert: Peer certificate cannot be authenticated with known CA certificates.
163
163
  # * :bad_content_encoding: Unrecognized transfer encoding.
164
164
  # * :ldap_invalid_url: Invalid LDAP URL.
165
165
  # * :filesize_exceeded: Maximum file size exceeded.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  class Easy
3
4
 
@@ -22,8 +23,8 @@ module Ethon
22
23
  Curl.set_option(:writefunction, body_write_callback, handle)
23
24
  Curl.set_option(:headerfunction, header_write_callback, handle)
24
25
  Curl.set_option(:debugfunction, debug_callback, handle)
25
- @response_body = ""
26
- @response_headers = ""
26
+ @response_body = String.new
27
+ @response_headers = String.new
27
28
  @headers_called = false
28
29
  @debug_info = Ethon::Easy::DebugInfo.new
29
30
  end
@@ -60,7 +61,7 @@ module Ethon
60
61
  # write the raw http request headers.
61
62
  #
62
63
  # @example Return the callback.
63
- # easy.body_write_callback
64
+ # easy.debug_callback
64
65
  #
65
66
  # @return [ Proc ] The callback.
66
67
  def debug_callback
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  class Easy
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Ethon
2
3
  class Easy
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'ethon/easy/util'
2
3
  require 'ethon/easy/queryable'
3
4