GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Refactor DnsNameResolver to be able to use different strategies when … by normanmaurer · Pull Request #14374 · netty/netty

Refactor DnsNameResolver to be able to use different strategies when … #14374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
normanmaurer merged 6 commits into 4.1 from dns_ref
Oct 1, 2024

Uh oh!

There was an error while loading. Please reload this page.

Merged

Refactor DnsNameResolver to be able to use different strategies when … #14374

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
6 commits
Select commit Hold shift + click to select a range
3a7b939
Refactor DnsNameResolver to be able to use different strategies when …
normanmaurer Sep 26, 2024
9de62e3
add ignore
normanmaurer Sep 30, 2024
ebbd956
done
normanmaurer Sep 30, 2024
20ce98b
Simplify
normanmaurer Oct 1, 2024
c7c7a0d
Simplify
normanmaurer Oct 1, 2024
3e4187a
Address comments and simplify
normanmaurer Oct 1, 2024
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

6 changes: 6 additions & 0 deletions 6 pom.xml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,12 @@
<new>method io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder::encoderIgnoreMaxHeaderListSize(boolean)</new>
<justification>Acceptable incompatibility for required change, because the method was not previously exposed; protected visiblity in super-class, not made public in final sub-class until now</justification>
</item>
<item>
<ignore>true</ignore>
<code>java.method.removed</code>
<old>method io.netty.channel.ChannelFactory&lt;&amp; extends io.netty.channel.socket.DatagramChannel&gt; io.netty.resolver.dns.DnsNameResolverBuilder::channelFactory()</old>
<justification>Protected methods of a final class.</justification>
</item>
</differences>
</revapi.differences>
</analysisConfiguration>
Expand Down
5 changes: 3 additions & 2 deletions 5 resolver-dns/src/main/java/io/netty/resolver/dns/DatagramDnsQueryContext.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.AddressedEnvelope;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.handler.codec.dns.DatagramDnsQuery;
import io.netty.handler.codec.dns.DnsQuery;
import io.netty.handler.codec.dns.DnsQuestion;
Expand All @@ -30,15 +31,15 @@

final class DatagramDnsQueryContext extends DnsQueryContext {

DatagramDnsQueryContext(Channel channel, Future<? extends Channel> channelReadyFuture,
DatagramDnsQueryContext(Channel channel,
InetSocketAddress nameServerAddr,
DnsQueryContextManager queryContextManager,
int maxPayLoadSize, boolean recursionDesired,
long queryTimeoutMillis,
DnsQuestion question, DnsRecord[] additionals,
Promise<AddressedEnvelope<DnsResponse, InetSocketAddress>> promise,
Bootstrap socketBootstrap, boolean retryWithTcpOnTimeout) {
super(channel, channelReadyFuture, nameServerAddr, queryContextManager, maxPayLoadSize, recursionDesired,
super(channel, nameServerAddr, queryContextManager, maxPayLoadSize, recursionDesired,
queryTimeoutMillis, question, additionals, promise, socketBootstrap, retryWithTcpOnTimeout);
}

Expand Down
11 changes: 5 additions & 6 deletions 11 resolver-dns/src/main/java/io/netty/resolver/dns/DnsAddressResolveContext.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.netty.channel.EventLoop;
import io.netty.handler.codec.dns.DnsRecord;
import io.netty.handler.codec.dns.DnsRecordType;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.Promise;

final class DnsAddressResolveContext extends DnsResolveContext<InetAddress> {
Expand All @@ -35,12 +34,12 @@ final class DnsAddressResolveContext extends DnsResolveContext<InetAddress> {
private final AuthoritativeDnsServerCache authoritativeDnsServerCache;
private final boolean completeEarlyIfPossible;

DnsAddressResolveContext(DnsNameResolver parent, Channel channel, Future<? extends Channel> channelReadyFuture,
DnsAddressResolveContext(DnsNameResolver parent, Channel channel,
Promise<?> originalPromise, String hostname, DnsRecord[] additionals,
DnsServerAddressStream nameServerAddrs, int allowedQueries, DnsCache resolveCache,
AuthoritativeDnsServerCache authoritativeDnsServerCache,
boolean completeEarlyIfPossible) {
super(parent, channel, channelReadyFuture, originalPromise, hostname, DnsRecord.CLASS_IN,
super(parent, channel, originalPromise, hostname, DnsRecord.CLASS_IN,
parent.resolveRecordTypes(), additionals, nameServerAddrs, allowedQueries);
this.resolveCache = resolveCache;
this.authoritativeDnsServerCache = authoritativeDnsServerCache;
Expand All @@ -49,13 +48,12 @@ final class DnsAddressResolveContext extends DnsResolveContext<InetAddress> {

@Override
DnsResolveContext<InetAddress> newResolverContext(DnsNameResolver parent, Channel channel,
Future<? extends Channel> channelReadyFuture,
Promise<?> originalPromise,
String hostname,
int dnsClass, DnsRecordType[] expectedTypes,
DnsRecord[] additionals,
DnsServerAddressStream nameServerAddrs, int allowedQueries) {
return new DnsAddressResolveContext(parent, channel, channelReadyFuture, originalPromise, hostname, additionals,
return new DnsAddressResolveContext(parent, channel, originalPromise, hostname, additionals,
nameServerAddrs, allowedQueries, resolveCache, authoritativeDnsServerCache, completeEarlyIfPossible);
}

Expand Down Expand Up @@ -84,7 +82,8 @@ boolean isDuplicateAllowed() {
@Override
void cache(String hostname, DnsRecord[] additionals,
DnsRecord result, InetAddress convertedResult) {
resolveCache.cache(hostname, additionals, convertedResult, result.timeToLive(), channel().eventLoop());
resolveCache.cache(hostname, additionals, convertedResult, result.timeToLive(),
channel().eventLoop());
}

@Override
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.