internetdata 2.20.0 → 2.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/internetdata/client.rb +3 -4
- data/lib/internetdata/transport.rb +6 -4
- data/lib/internetdata/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9753502a706d802663e90a4c440a1a9eb37cb9c018180e0a6a1088bb4dc2928d
|
|
4
|
+
data.tar.gz: 6f9f6e87a5858bcdb3ab041ca1aea6c10a290ed0005c4757facb32765c9eb378
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad44a99b6e0d9c0e5696ad882c8c54c58d28bcceb8175905deb5578370f79053776646a2276d97ffe33f8223cbbeffe1d2fd5d807cf50456f59d2ef04630c6a2
|
|
7
|
+
data.tar.gz: d57884b23e959bde28958e9f51ab22878bbc56b89015acec6dfca6eaca788dfd4efc446dce61e2553bf5b24da9897c7bd30ec93b84176e39acf20784978b5426
|
data/README.md
CHANGED
|
@@ -250,7 +250,7 @@ result = client.lookup('146.70.116.130', timeout: 2, retries: 0)
|
|
|
250
250
|
catalog = client.database.list(timeout: 5)
|
|
251
251
|
```
|
|
252
252
|
|
|
253
|
-
`timeout` is in seconds and bounds each attempt, body included, so a call that is retried can take longer in total. It defaults to 30 seconds, and 0 means no bound. The client's values are defaults: `lookup`, `lookup_asn`, `lookup_domain`, `lookup_batch`, `my_ip` and `my_entitlement` each take `timeout:` and `retries:` for that call alone, and `list`, `metadata`, `checksums`, `downloads`, `download_url` and every `client.oauth` method take `timeout:`. A negative value, anything that isn't a number, and anything past 2147483
|
|
253
|
+
`timeout` is in seconds and bounds each attempt, body included, so a call that is retried can take longer in total. It defaults to 30 seconds, and 0 means no bound. The client's values are defaults: `lookup`, `lookup_asn`, `lookup_domain`, `lookup_batch`, `my_ip` and `my_entitlement` each take `timeout:` and `retries:` for that call alone, and `list`, `metadata`, `checksums`, `downloads`, `download_url` and every `client.oauth` method take `timeout:`. A negative value, anything that isn't a number, and anything past 2147483 seconds (the longest curl holds) raise `ArgumentError` where you pass them, before any request. So does a `retries` that isn't an Integer from 0, and a `concurrency` that isn't an Integer from 1 given to `Client.new`, which `lookup_batch` refuses as `:bad_request`.
|
|
254
254
|
|
|
255
255
|
`download` and `download_bytes` take no `timeout:` and raise `ArgumentError` if handed one, rather than accepting it and quietly doing nothing: a transfer runs to gigabytes and minutes, so any bound that suits a JSON call would abandon a healthy download. They bound only their connection with the client's value. `download_url` does take one, because minting the link is an ordinary API request - it bounds that request, not whatever you do with the link afterwards.
|
|
256
256
|
|
data/lib/internetdata/client.rb
CHANGED
|
@@ -45,10 +45,9 @@ module InternetData
|
|
|
45
45
|
# phase with it.
|
|
46
46
|
# @raise [ArgumentError] for an `api_key` with a control character in it.
|
|
47
47
|
# @raise [ArgumentError] for a `timeout`, here or on any call, that is
|
|
48
|
-
# negative, not a finite number, or past 2147483
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
# from 1.
|
|
48
|
+
# negative, not a finite number, or past 2147483 seconds, the longest curl
|
|
49
|
+
# holds, for a `retries`, here or on any call, that is not an Integer from
|
|
50
|
+
# 0, and for a `concurrency` that is not an Integer from 1.
|
|
52
51
|
# @param transport [Transport, nil] override the HTTP layer, mostly for tests.
|
|
53
52
|
def initialize(api_key: nil, base_url: DEFAULT_BASE_URL, cache: true,
|
|
54
53
|
cache_max_size: DEFAULT_CACHE_MAX_SIZE, cache_ttl: DEFAULT_CACHE_TTL,
|
|
@@ -23,10 +23,12 @@ module InternetData
|
|
|
23
23
|
# under the database's spelling, so a lookup names that.
|
|
24
24
|
LOOKUP_AUTH = %w[BearerAuth].freeze
|
|
25
25
|
|
|
26
|
-
# The longest `timeout` curl holds, in seconds:
|
|
27
|
-
# libcurl refuses a longer one, and any negative, and Ethon ignores
|
|
28
|
-
# refusal, so the call would run with no bound at all.
|
|
29
|
-
|
|
26
|
+
# The longest `timeout` curl holds, in whole seconds: INT_MAX / 1000, about
|
|
27
|
+
# 24.8 days. libcurl refuses a longer one, and any negative, and Ethon ignores
|
|
28
|
+
# the refusal, so the call would run with no bound at all. Not 2**31 - 1 ms:
|
|
29
|
+
# Typhoeus rounds a fraction UP to a whole second, so 2147483.001 reached
|
|
30
|
+
# libcurl as 2147484 and failed every call with a raw Ethon::Errors::SetOption.
|
|
31
|
+
LONGEST_TIMEOUT = 2_147_483
|
|
30
32
|
|
|
31
33
|
# `timeout`, once it is a bound curl can hold: seconds, 0 for none. Refused
|
|
32
34
|
# where it is set, because nothing downstream refuses it: a negative ran with
|
data/lib/internetdata/version.rb
CHANGED