Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
Set DNS timeout to 1 second
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuhaow committed Dec 9, 2016
1 parent bc6ff80 commit 82fca49
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
I will do my best to guarantee that this project adheres to [Semantic Versioning](http://semver.org/) after 1.0.0, but please do read change log before updating.

## 0.10.2

### Changed
- Set DNS timeout to 1 second.

## 0.10.1

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions src/Opt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ public struct Opt {
public static var MAXHTTPContentBlockLength = 10240

public static var RejectAdapterDefaultDelay = 300

public static var DNSTimeout = 1
}
2 changes: 1 addition & 1 deletion src/Tunnel/Tunnel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public class Tunnel: NSObject, SocketDelegate {
observer?.signal(.receivedRequest(request, from: from, on: self))

if !request.isIP() {
_ = Resolver.resolve(hostname: request.host) { [weak self] resolver, err in
_ = Resolver.resolve(hostname: request.host, timeout: Opt.DNSTimeout) { [weak self] resolver, err in
QueueFactory.getQueue().async {
if err != nil {
request.ipAddress = ""
Expand Down

0 comments on commit 82fca49

Please sign in to comment.