ethon 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 558abec878f87a7e13113e513faf1dc5970cfcc12d3b0a8d4faaec50e847e1c9
4
- data.tar.gz: 979dbda54e8b12f1a93fee6bb16db05c1960719f44c7d2152e5d9aaddd783d4e
3
+ metadata.gz: 87e1825a32b82c558aded416768e7dffc8a1be6918bca888187b343e17159432
4
+ data.tar.gz: 4773483d3d4e5bf46298d55c4d4967622666bf28f6665445d621ab2b4de30213
5
5
  SHA512:
6
- metadata.gz: 63339cb7a38df43138df7fb52c88d8764d7b1f04bea134781338a676a6a567e8850b9ef24f5db1268a126f9d43b31f6d0ecc6b1441bd8bb6ef7572e7d2c366bd
7
- data.tar.gz: f516c95eb23a3dd70d4ee25e76bd100d2cb5d2cf38fd8d626c584c2b71e9307084b0d07598d01c595447c5b241b50a58259aca7da29cdc65db404ebf9fb622f7
6
+ metadata.gz: bc51f162c86e89ddc1176368a508870e0be217a11027ae17d93149cbc04ae822d2d03ce6e2fa0e15269bbafefbda9e2dbfd1e64aba0b4e3fddbf820b958a3b82
7
+ data.tar.gz: 8c755c396544992d6062fe28f3a7a741c3269941665e89995a5f5060d08b4ed8d4f5768bc0601efa7780b1407c49d1839e4557f3ac591abc0529438ad8506163
data/lib/ethon.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require 'logger'
3
3
  require 'ffi'
4
- require 'ffi/tools/const_generator'
5
4
  require 'thread'
6
5
  begin
7
6
  require 'mime/types/columnar'
@@ -33,7 +33,7 @@ module Ethon
33
33
  def clear; self[:fd_count] = 0; end
34
34
  else
35
35
  # FD Set size.
36
- FD_SETSIZE = ::Ethon::Libc.sysconf(:open_max)
36
+ FD_SETSIZE = ::Ethon::Libc.getdtablesize
37
37
  layout :fds_bits, [:long, FD_SETSIZE / ::FFI::Type::LONG.size]
38
38
 
39
39
  # :nodoc:
@@ -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
data/lib/ethon/libc.rb CHANGED
@@ -14,21 +14,7 @@ module Ethon
14
14
  end
15
15
 
16
16
  unless windows?
17
- fcg = FFI::ConstGenerator.new do |gen|
18
- gen.include 'unistd.h'
19
- %w[
20
- _SC_OPEN_MAX
21
- ].each do |const|
22
- ruby_name = const.sub(/^_SC_/, '').downcase.to_sym
23
- gen.const(const, "%d", nil, ruby_name, &:to_i)
24
- end
25
- end
26
-
27
- CONF = enum(*fcg.constants.map{|_, const|
28
- [const.ruby_name, const.converted_value]
29
- }.flatten)
30
-
31
- attach_function :sysconf, [CONF], :long
17
+ attach_function :getdtablesize, [], :int
32
18
  attach_function :free, [:pointer], :void
33
19
  end
34
20
  end
@@ -9,7 +9,7 @@ module Ethon
9
9
  # Sets max_total_connections option.
10
10
  #
11
11
  # @example Set max_total_connections option.
12
- # easy.max_total_conections = $value
12
+ # multi.max_total_conections = $value
13
13
  #
14
14
  # @param [ String ] value The value to set.
15
15
  #
@@ -21,7 +21,7 @@ module Ethon
21
21
  # Sets maxconnects option.
22
22
  #
23
23
  # @example Set maxconnects option.
24
- # easy.maxconnects = $value
24
+ # multi.maxconnects = $value
25
25
  #
26
26
  # @param [ String ] value The value to set.
27
27
  #
@@ -33,7 +33,7 @@ module Ethon
33
33
  # Sets pipelining option.
34
34
  #
35
35
  # @example Set pipelining option.
36
- # easy.pipelining = $value
36
+ # multi.pipelining = $value
37
37
  #
38
38
  # @param [ String ] value The value to set.
39
39
  #
@@ -45,7 +45,7 @@ module Ethon
45
45
  # Sets socketdata option.
46
46
  #
47
47
  # @example Set socketdata option.
48
- # easy.socketdata = $value
48
+ # multi.socketdata = $value
49
49
  #
50
50
  # @param [ String ] value The value to set.
51
51
  #
@@ -57,7 +57,7 @@ module Ethon
57
57
  # Sets socketfunction option.
58
58
  #
59
59
  # @example Set socketfunction option.
60
- # easy.socketfunction = $value
60
+ # multi.socketfunction = $value
61
61
  #
62
62
  # @param [ String ] value The value to set.
63
63
  #
@@ -69,7 +69,7 @@ module Ethon
69
69
  # Sets timerdata option.
70
70
  #
71
71
  # @example Set timerdata option.
72
- # easy.timerdata = $value
72
+ # multi.timerdata = $value
73
73
  #
74
74
  # @param [ String ] value The value to set.
75
75
  #
@@ -81,7 +81,7 @@ module Ethon
81
81
  # Sets timerfunction option.
82
82
  #
83
83
  # @example Set timerfunction option.
84
- # easy.timerfunction = $value
84
+ # multi.timerfunction = $value
85
85
  #
86
86
  # @param [ String ] value The value to set.
87
87
  #
data/lib/ethon/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  module Ethon
3
3
 
4
4
  # Ethon version.
5
- VERSION = '0.13.0'
5
+ VERSION = '0.14.0'
6
6
  end
@@ -2,13 +2,13 @@
2
2
  require 'spec_helper'
3
3
 
4
4
  describe Ethon::Libc do
5
- describe "#sysconf(:open_max)", :if => !Ethon::Curl.windows? do
5
+ describe "#getdtablesize", :if => !Ethon::Curl.windows? do
6
6
  it "returns an integer" do
7
- expect(Ethon::Libc.sysconf(:open_max)).to be_a(Integer)
7
+ expect(Ethon::Libc.getdtablesize).to be_a(Integer)
8
8
  end
9
9
 
10
10
  it "returns bigger zero", :if => !Ethon::Curl.windows? do
11
- expect(Ethon::Libc.sysconf(:open_max)).to_not be_zero
11
+ expect(Ethon::Libc.getdtablesize).to_not be_zero
12
12
  end
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hans Hasselberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-11 00:00:00.000000000 Z
11
+ date: 2021-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi