Commit Graph

69 Commits

Author SHA1 Message Date
Frank Denis 0f332c644d Set a minimum TTL when caching resolver IPs
Comcast having a 30 sec TTL is silly
2019-11-02 02:01:03 +01:00
Frank Denis 63ed3b4fef Update comment 2019-11-02 01:52:51 +01:00
Frank Denis a84a789a8a Keep resolving if needed 2019-11-02 01:50:35 +01:00
Frank Denis d932d5fdfc Inverse test 2019-11-02 01:20:28 +01:00
Frank Denis 6032c3b79b Add a grace TTL for expired cached IPs
And some comments to make the code more readable
2019-11-01 23:19:07 +01:00
Frank Denis 0dc69eacd5 resolveHostWithCache -> resolveWithCache 2019-11-01 23:10:36 +01:00
Frank Denis b30904f20b lowercase 2019-11-01 23:06:42 +01:00
Frank Denis 8d191cdcf1 Rename CheckResolver to IsIPAndPort for clarity 2019-11-01 23:05:17 +01:00
Frank Denis 3cef651b07 Rename resolveHost() to resolveHostWithCache() for clarity
(but to be honest, I don't understand anything to that code any more)
2019-11-01 23:00:39 +01:00
Frank Denis e028f4d483 Don't delete cached server IP addresses
If we can't update an entry, keep the previous one.
2019-11-01 22:55:06 +01:00
Frank Denis 3db3de0a91 Use SystemResolverTTL as a minimum timeout for cached resolver IPs 2019-11-01 21:47:13 +01:00
Frank Denis 59c3d5121d Add brackets around cached IPv6 IP addresses
Fixes #1005
2019-10-31 17:55:54 +01:00
Frank Denis 3a68f90c37 Back to 2.0.29 beta 3 (ceed905196) 2019-10-31 17:50:19 +01:00
Frank Denis 71e3cf4aef Add brackets around cached IPv6 IP addresses
Fixes #1005
2019-10-31 16:38:43 +01:00
Frank Denis a0614510e9 Don't name different things "ttl" to avoid confusion 2019-10-21 18:40:47 +02:00
Frank Denis ffd60d21db Reduce lock contention 2019-10-21 18:36:47 +02:00
Frank Denis 70970d2333 Nits 2019-10-21 18:31:06 +02:00
Markus Linnala bc831816f5 feature: xtransport: Expire CachedIPs, split resolve function from Fetch
I selected default ttl when resolving using system to be 86400 / 24h.

As the program can run long time, I think it is relevant to honor TTL
when resolving and caching results.

Change cache internal format from string to net.IP. This should ensure
there is no need to further check validity of value later when using.

Resolve part was too big and had only one purpose. So it is fine
candidate to be own function.
2019-10-21 18:12:49 +02:00
Markus Linnala d14d78e648 fix: xtransport: Check 'fallback_resolver'
And also DefaultFallbackResolver.

As far a I could see, value needs to have port defined
too. dns.Exchange does seem to use address as such.
2019-10-21 18:12:49 +02:00
Markus Linnala 890dcca270 fix: xtransport: Ensure we strip [] from host/ip before net.ParseIP 2019-10-21 18:12:49 +02:00
Markus Linnala ac4843b460 cleanup: xtransport: group all consts and alike
This is mainly for case where more consts are added.

Also I think those vars were not variables but treated as
const.
2019-10-21 18:12:49 +02:00
Markus Linnala a941cbd893 cleanup: xtransport: simplify body creation 2019-10-18 20:24:11 +02:00
Markus Linnala 345ec56cab cleanup: xtransport: move onion check earlier to fail fast 2019-10-18 20:24:11 +02:00
Markus Linnala df03065eaf change: xtransport: Return http response status string as error, do name make own string
This gives much better possibilities to diagnose problems than error
message with only "informative" part being 500.
2019-10-18 20:24:11 +02:00
Markus Linnala 72681725b1 clanup: xtransport: use MaxDNSPacketSize more 2019-10-18 20:24:11 +02:00
Markus Linnala 0d553a9fa7 cleanup: Drop ExtractPort ExtractHost, use ExtractHostAndPort instead 2019-10-18 20:24:11 +02:00
Markus Linnala f0fae0c756 cleanup: xtransport: There is no function level foundIP in resolveUsingResolver
Rename foundIPx to foundIP just to make it nicer looking.
2019-10-18 20:24:11 +02:00
Frank Denis 6b1966b38f Strip the port when caching the host part of URLs
Fixes #888
2019-09-07 15:31:34 +02:00
Frank Denis 0569c75596 Propagate mainProto to xTransport
Fixes #880
2019-07-10 13:13:28 +02:00
Frank Denis 7ca40df7c1 Save a line 2019-06-26 19:51:57 +02:00
Frank Denis 5c9edfccfe Ignore onion servers if Tor is not being used 2019-04-14 14:19:12 +02:00
Frank Denis 4940b34c76 Improve caching of server addresses, especially when using proxies 2019-04-14 13:46:07 +02:00
Frank Denis 4b001e3b8e Skip DNS resolution on Tor services 2019-04-14 11:18:14 +02:00
Frank Denis 4a7c932fdc Remove debug statement 2018-11-22 18:13:30 +01:00
Frank Denis 70bdd46425 Add a hash of the query to POST requests 2018-11-22 18:09:27 +01:00
Frank Denis fd9e97a570 Pad only once 2018-11-22 17:59:11 +01:00
Frank Denis 68ff5d2205 Set the Content-Length for POST queries 2018-11-22 17:23:22 +01:00
Frank Denis 2e147364e9 Add support for HTTP/HTTPS proxies
Fixes #638
2018-11-15 18:47:33 +01:00
Frank Denis 62755427a2 Always include the Accept: header in GET queries 2018-11-15 08:56:22 +01:00
Frank Denis d58d5ffbf6 Oh, Google updated their servers, and "body" is not required any more! 2018-10-03 18:33:10 +02:00
Frank Denis 0166f21b27 Add built-in support for Tor 2018-06-06 15:54:51 +02:00
Frank Denis da06657963 application/dns-message 2018-05-19 02:39:32 +02:00
Frank Denis 281c2fa7f4 Don't add padding if the query matches the block size
Fixes #446
2018-05-16 11:31:47 +02:00
Frank Denis 3d67c81697 Deps update 2018-04-18 18:58:39 +02:00
Frank Denis f63dc17f90 stamps -> dnsstamps 2018-04-18 18:47:10 +02:00
gdm85 eb5f391fa6 Split stamps into package 2018-04-18 18:36:47 +02:00
Frank Denis 3dbdf54c1f Warn about failed handshakes earlier and fallback to default suite 2018-04-11 11:42:30 +02:00
Frank Denis e3ad6b1c0e Actually use a cache if tlsDisableSessionTickets is not set 2018-04-10 00:36:55 +02:00
Frank Denis fbe91ee58b No need to initialize xTransport before we have all the parameters 2018-04-07 22:33:11 +02:00
Frank Denis 1fa3e5d7f3 Add options to set the cipher suite as well as disable session tickets 2018-04-07 22:23:29 +02:00