Skip to content

Commit

Permalink
Revert "Allocate/free an SPF server on each request"
Browse files Browse the repository at this point in the history
This reverts commit a586763.
  • Loading branch information
andrenth committed Dec 27, 2012
1 parent f7dc5e8 commit 7661f55
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/milter_callbacks.ml
Expand Up @@ -63,6 +63,8 @@ let choose_forward_domain rcpts =
Lwt_preemptive.run_in_main (fun () -> ops.choose_forward_domain rcpts) in
run (O.some !proxymap_ops)

let spf = SPF.server SPF.Dns_cache

let srs_re = Str.regexp "^SRS\\([01]\\)[=+-]"

let with_priv_data z ctx f =
Expand Down Expand Up @@ -104,16 +106,10 @@ let detached_in_main f x =
Lwt_preemptive.run_in_main (fun () -> Lwt_preemptive.detach f x)

let check_helo addr helo =
let spf = SPF.server SPF.Dns_cache in
let res = detached_in_main (SPF.check_helo spf addr) helo in
SPF.free_server spf;
res
detached_in_main (SPF.check_helo spf addr) helo

let check_from addr from =
let spf = SPF.server SPF.Dns_cache in
let res = detached_in_main (SPF.check_from spf addr) from in
SPF.free_server spf;
res
detached_in_main (SPF.check_from spf addr) from

let spf_check_helo ctx priv =
let addr = priv.addr in
Expand Down

0 comments on commit 7661f55

Please sign in to comment.