Skip to content

Commit

Permalink
Remove dnspool: disable cgo to limit thread creation caused by DNS.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Jan 15, 2013
1 parent a44ffcb commit 7617bef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cmd/shadowsocks-server/server.go
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/gob"
"errors"
"flag"
"github.com/cyfdecyf/dnspool"
ss "github.com/shadowsocks/shadowsocks-go/shadowsocks"
"io"
"log"
Expand Down Expand Up @@ -119,7 +118,7 @@ func handleConnection(conn *ss.Conn) {
return
}
debug.Println("connecting", host)
remote, err := dnspool.Dial(host)
remote, err := net.Dial("tcp", host)
if err != nil {
if ne, ok := err.(*net.OpError); ok && (ne.Err == syscall.EMFILE || ne.Err == syscall.ENFILE) {
// log too many open file error
Expand Down Expand Up @@ -414,8 +413,6 @@ func main() {
os.Exit(1)
}

dnspool.SetGoroutineNumber(dnsGoroutineNum)

initTableCache(config)
for port, password := range config.PortPassword {
go run(port, password)
Expand Down

0 comments on commit 7617bef

Please sign in to comment.