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
e2a83e51
Commit
e2a83e51
authored
Apr 13, 2018
by
Daniel Wolf
Browse files
The workaround has to be performed on versions below lollipop, not every version exception
parent
f1d0ae56
Changes
2
Show whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/dnschanger/util/dnsproxy/DNSTCPProxy.java
View file @
e2a83e51
...
...
@@ -183,8 +183,6 @@ public class DNSTCPProxy extends DNSProxy{
private
int
pollTries
=
0
;
private
void
poll
(
StructPollfd
[]
polls
,
int
timeout
)
throws
ErrnoException
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
){
Os
.
poll
(
polls
,
timeout
);
}
else
{
pollTries
++;
try
{
Os
.
poll
(
polls
,
timeout
/
pollTries
);
...
...
@@ -193,6 +191,8 @@ public class DNSTCPProxy extends DNSProxy{
if
(
pollTries
<
3
)
poll
(
polls
,
timeout
);
else
throw
ex
;
}
}
else
{
Os
.
poll
(
polls
,
timeout
);
}
}
...
...
app/src/main/java/com/frostnerd/dnschanger/util/dnsproxy/DNSUDPProxy.java
View file @
e2a83e51
...
...
@@ -174,8 +174,6 @@ public class DNSUDPProxy extends DNSProxy{
private
int
pollTries
=
0
;
private
void
poll
(
StructPollfd
[]
polls
,
int
timeout
)
throws
ErrnoException
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
){
Os
.
poll
(
polls
,
timeout
);
}
else
{
pollTries
++;
try
{
Os
.
poll
(
polls
,
timeout
/
pollTries
);
...
...
@@ -184,6 +182,8 @@ public class DNSUDPProxy extends DNSProxy{
if
(
pollTries
<
3
)
poll
(
polls
,
timeout
);
else
throw
ex
;
}
}
else
{
Os
.
poll
(
polls
,
timeout
);
}
}
...
...
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