Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wade
DnsChanger
Commits
4b987b8c
Commit
4b987b8c
authored
Apr 14, 2018
by
Daniel Wolf
Browse files
The resolver only has to be created when resolving is active
parent
dc9fda67
Changes
2
Show whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/dnschanger/util/dnsproxy/DNSTCPProxy.java
View file @
4b987b8c
...
...
@@ -117,7 +117,6 @@ public class DNSTCPProxy extends DNSProxy{
if
(
parcelFileDescriptor
==
null
)
throw
new
IllegalStateException
(
"The ParcelFileDescriptor passed to DNSTCPProxy is null."
);
if
(
context
==
null
)
throw
new
IllegalStateException
(
"The DNSVPNService passed to DNSTCPProxy is null."
);
this
.
parcelFileDescriptor
=
parcelFileDescriptor
;
resolver
=
new
DNSResolver
(
context
);
this
.
vpnService
=
context
;
for
(
IPPortPair
pair:
upstreamDNSServers
){
if
(
pair
!=
IPPortPair
.
getEmptyPair
()
&&
!
pair
.
getAddress
().
equals
(
""
))
this
.
upstreamServers
.
put
(
pair
.
getAddress
(),
pair
.
getPort
());
...
...
@@ -125,6 +124,7 @@ public class DNSTCPProxy extends DNSProxy{
this
.
resolveLocalRules
=
resolveLocalRules
;
this
.
queryLogging
=
queryLogging
;
if
(
queryLogging
)
queryLogger
=
new
QueryLogger
(
DatabaseHelper
.
getInstance
(
context
));
if
(
resolveLocalRules
)
resolver
=
new
DNSResolver
(
context
);
this
.
timeout
=
timeout
;
}
...
...
app/src/main/java/com/frostnerd/dnschanger/util/dnsproxy/DNSUDPProxy.java
View file @
4b987b8c
...
...
@@ -108,14 +108,14 @@ public class DNSUDPProxy extends DNSProxy{
if
(
parcelFileDescriptor
==
null
)
throw
new
IllegalStateException
(
"The ParcelFileDescriptor passed to DNSUDPProxy is null."
);
if
(
context
==
null
)
throw
new
IllegalStateException
(
"The DNSVPNService passed to DNSUDPProxy is null."
);
this
.
parcelFileDescriptor
=
parcelFileDescriptor
;
resolver
=
new
DNSResolver
(
context
);
this
.
vpnService
=
context
;
for
(
IPPortPair
pair:
upstreamDNSServers
){
if
(
pair
!=
IPPortPair
.
getEmptyPair
()
&&
!
pair
.
getAddress
().
equals
(
""
))
this
.
upstreamServers
.
put
(
pair
.
getAddress
(),
pair
.
getPort
());
}
this
.
resolveLocalRules
=
resolveLocalRules
;
this
.
queryLogging
=
queryLogging
;
if
(
queryLogging
)
queryLogger
=
new
QueryLogger
(
DatabaseHelper
.
getInstance
(
context
));
if
(
queryLogging
)
queryLogger
=
new
QueryLogger
(
DatabaseHelper
.
getInstance
(
context
));
if
(
resolveLocalRules
)
resolver
=
new
DNSResolver
(
context
);
}
@Override
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment