Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b07730c

Browse files
committedApr 19, 2012
handle UDP responses asynchronously rather than waiting for a Netif response
1 parent 320265c commit b07730c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
 

‎lib/dns/server.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ let no_memo mgr src dst bits =
6868
let q = List.hd d.questions in
6969
let r = get_answer q.q_name q.q_type d.id in
7070
let p = marshal r in
71-
Net.Datagram.UDPv4.send mgr ~src dst p
71+
let _ = Net.Datagram.UDPv4.send mgr ~src dst p in return ()
7272
)
7373

7474
let leaky mgr src dst bits =
@@ -78,12 +78,12 @@ let leaky mgr src dst bits =
7878
let q = List.hd d.questions in
7979
let r = get_answer_memo q.q_name q.q_type d.id in
8080
let p = marshal r in
81-
8281
Net.Datagram.UDPv4.send mgr ~src dst p
8382
)
8483

8584
let listen ?(mode=`none) ~zonebuf mgr src =
8685
Dnsserver.load_zone [] zonebuf;
86+
Gc.compact ();
8787
Net.Datagram.UDPv4.(recv mgr src
8888
(match mode with
8989
|`none -> no_memo mgr src

‎lib/net/direct/udp.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ let input t ~src ~dst pkt =
2929
checksum:16; data:(length-8)*8:bitstring } ->
3030
if Hashtbl.mem t.listeners dest_port then begin
3131
let fn = Hashtbl.find t.listeners dest_port in
32-
fn ~src ~dst ~source_port data
32+
let _ = fn ~src ~dst ~source_port data in
33+
return ()
3334
end else
3435
return ()
3536

0 commit comments

Comments
 (0)
Please sign in to comment.