Skip to content

Commit

Permalink
Merge branch 'blocklist_state' of github.com:emdioh/grimd into blockl…
Browse files Browse the repository at this point in the history
…ist_state
  • Loading branch information
Marco Dondero committed Oct 9, 2018
2 parents 462e564 + 23967df commit 2a465bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api.go
Expand Up @@ -9,12 +9,18 @@ import (
"gopkg.in/gin-contrib/cors.v1"
)

<<<<<<< HEAD
// StartAPIServer starts the API server
func StartAPIServer(config *Config,
reloadChan chan bool,
blockCache *MemoryBlockCache,
questionCache *MemoryQuestionCache) (*http.Server, error) {
if config.LogLevel < 2 {
=======
// StartAPIServer launches the API server
func StartAPIServer(config *Config, blockCache *MemoryBlockCache, questionCache *MemoryQuestionCache) error {
if config.LogLevel == 0 {
>>>>>>> 23967dfdc40cde995257c350b7a2dce282953e73
gin.SetMode(gin.ReleaseMode)
}

Expand Down
4 changes: 4 additions & 0 deletions main.go
Expand Up @@ -39,6 +39,10 @@ func reloadBlockCache(config *Config,
}

func main() {
// BlockCache contains all blocked domains
blockCache := &MemoryBlockCache{Backend: make(map[string]bool)}
// QuestionCache contains all queries to the dns server
questionCache := &MemoryQuestionCache{Backend: make([]QuestionCacheEntry, 0), Maxcount: 1000}

flag.Parse()

Expand Down
4 changes: 3 additions & 1 deletion server.go
Expand Up @@ -17,7 +17,9 @@ type Server struct {
}

// Run starts the server
func (s *Server) Run(config *Config, blockCache *MemoryBlockCache, questionCache *MemoryQuestionCache) {
func (s *Server) Run(config *Config,
blockCache *MemoryBlockCache,
questionCache *MemoryQuestionCache) {
s.handler = NewHandler(config, blockCache, questionCache)

tcpHandler := dns.NewServeMux()
Expand Down

0 comments on commit 2a465bb

Please sign in to comment.