-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DNSProxy -> DNSResolver; clenaup unused code
- Loading branch information
Showing
4 changed files
with
35 additions
and
128 deletions.
There are no files selected for viewing
109 changes: 0 additions & 109 deletions
109
orbotservice/src/main/java/org/torproject/android/service/vpn/DNSProxy.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
orbotservice/src/main/java/org/torproject/android/service/vpn/DNSResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.torproject.android.service.vpn; | ||
|
||
import org.xbill.DNS.Message; | ||
import org.xbill.DNS.SimpleResolver; | ||
|
||
import java.io.IOException; | ||
|
||
public class DNSResolver { | ||
|
||
private final SimpleResolver mResolver; | ||
|
||
public DNSResolver(String localDns, int localPort) throws IOException { | ||
mResolver = new SimpleResolver(localDns); | ||
mResolver.setPort(localPort); | ||
} | ||
|
||
public byte[] processDNS(byte[] payload) throws IOException { | ||
Message msgRequest = new Message(payload); | ||
|
||
if (msgRequest.getQuestion() != null) { | ||
Message queryMessage = Message.newQuery(msgRequest.getQuestion()); | ||
Message answer = mResolver.send(queryMessage); | ||
return answer.toWire(); | ||
} | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters