Do not use port 8618, it's a leftover from a time when we had two binaries.

Should fix 378 but needs testing from users having the problem since couldn't reproduce it here yet.
This commit is contained in:
Eugene Bujak
2018-10-17 18:55:27 +03:00
parent bdfb141d36
commit 5437a9d3a6
5 changed files with 22 additions and 196 deletions

View File

@@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"log"
"net"
"net/http"
"os"
"path"
@@ -108,7 +107,7 @@ func logRequest(question *dns.Msg, answer *dns.Msg, result dnsfilter.Result, ela
}
}
func handleQueryLog(w http.ResponseWriter, r *http.Request) {
func HandleQueryLog(w http.ResponseWriter, r *http.Request) {
queryLogLock.RLock()
values := make([]*logEntry, len(queryLogCache))
copy(values, queryLogCache)
@@ -226,22 +225,6 @@ func handleQueryLog(w http.ResponseWriter, r *http.Request) {
}
}
func startQueryLogServer() {
listenAddr := net.JoinHostPort("127.0.0.1", queryLogAPIPort)
go periodicQueryLogRotate()
go periodicHourlyTopRotate()
go statsRotator()
http.HandleFunc("/querylog", handleQueryLog)
http.HandleFunc("/stats", handleStats)
http.HandleFunc("/stats_top", handleStatsTop)
http.HandleFunc("/stats_history", handleStatsHistory)
if err := http.ListenAndServe(listenAddr, nil); err != nil {
log.Fatalf("error in ListenAndServe: %s", err)
}
}
func trace(format string, args ...interface{}) {
pc := make([]uintptr, 10) // at least 1 entry needed
runtime.Callers(2, pc)