]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
misc commit
authorMiek Gieben <miekg@NLnetLabs.nl>
Wed, 24 Aug 2005 10:45:01 +0000 (10:45 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Wed, 24 Aug 2005 10:45:01 +0000 (10:45 +0000)
lua/lua-todo
lua/rns.lua

index d709786d9d7aa49617766072f86414ad88e7845b..f86b2ff9f4495e6597f7d98b2711faf420d46d0d 100644 (file)
@@ -1,3 +1,6 @@
-fix segfault
+There is a strange networking problem, calling udp_read more than once
+gives an error 
+upd.read (with a dot) doesn't work at all.
 
-fix pkt printing its id: <id>
+I suspect these 2 errors are related. It may be the case this is a bug
+in the core ldns
index 0727df1b5335a6463e43dc30ecf203f2faca0a1f..011d5848707e94d96e27ec9ee8f343224177eaf6 100644 (file)
@@ -18,6 +18,9 @@ pkt = packet.push_rr(pkt, LDNS_SECTION_AUTHORITY, rr3)
 rdf_ip = rdf.new_frm_str(LDNS_RDF_TYPE_A, "127.0.0.1")
 socket = udp.open(rdf_ip, 5353)
 
+
+while true do
+
 -- read from the socket, this blocks...
 wirebuf, sockaddr_from, fromlen  = udp_read(socket) -- this works
 --wirebuf, sockaddr_from, fromlen  = udp.read(socket) -- this doesn't
@@ -31,6 +34,11 @@ else
 
        lua_debug("received from the interface")
 
+       -- next we must send it to our recursive nameserver
+       -- and pick up the result
+       -- then we modify the result somewhat and sent it back
+       -- to the client
+
        id = packet.id(wirepkt);
        packet.print(wirepkt)
 
@@ -39,6 +47,7 @@ else
        lua_packet_ancount_incr(pkt, 2)
        wirebuf2 = packet.to_buf(pkt)
 
+       -- write back to the client
        bytes = lua_udp_write(socket, wirebuf2, sockaddr_from)
        if bytes == -1 then
                lua_debug("write error")
@@ -49,4 +58,6 @@ else
        
 end
 
+end
+
 udp.close(socket)