]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doh: remove devel output
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 3 Apr 2019 14:29:17 +0000 (16:29 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 11 Apr 2019 07:12:48 +0000 (09:12 +0200)
daemon/bindings/worker.c
modules/http/http_doh.lua
modules/http/http_doh.test.lua

index 7f961406e30b4a4948c7728244837e33fface854..d4761a45646344cdb8473e22d72ae4f95100d91f 100644 (file)
     along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
-#include "contrib/cleanup.h"
-
 #include "daemon/bindings/impl.h"
 
 #include "daemon/worker.h"
 
-    static void stackDump (lua_State *L) {
-      int i;
-      int top = lua_gettop(L);
-      for (i = 1; i <= top; i++) {  /* repeat for each level */
-        int t = lua_type(L, i);
-        printf("%d  ", i);  /* put a separator */
-        switch (t) {
-    
-          case LUA_TSTRING:  /* strings */
-            printf("`%s'", lua_tostring(L, i));
-            break;
-    
-          case LUA_TBOOLEAN:  /* booleans */
-            printf(lua_toboolean(L, i) ? "true" : "false");
-            break;
-    
-          case LUA_TNUMBER:  /* numbers */
-            printf("%g", lua_tonumber(L, i));
-            break;
-    
-          default:  /* other values */
-            printf("%s", lua_typename(L, t));
-            break;
-    
-        }
-        printf("  ");  /* put a separator */
-      }
-      printf("\n");  /* end the listing */
-    }
-
-
 static int wrk_resolve_pkt(lua_State *L)
 {
-       stackDump(L);
        struct worker_ctx *worker = wrk_luaget(L);
        if (!worker) {
                return 0;
@@ -65,9 +31,6 @@ static int wrk_resolve_pkt(lua_State *L)
        if (!pkt)
                lua_error_maybe(L, ENOMEM);
 
-       auto_free char *debug = kr_pkt_text(pkt);
-       printf("%s\n", debug);
-
        /* Create task and start with a first question */
 
        struct qr_task *task = worker_resolve_start(worker, pkt, options);
index 68ee3b17728a51b6fcb58be5cadb2f2f574ef82c..5768cf8217e3bdad219a27dafc032c5d17dd92e0 100644 (file)
@@ -64,8 +64,6 @@ local function serve_doh(h, stream)
        local cond = condition.new()
        local waiting, done = false, false
        local finish_cb = function (answer, req)
-               print(tostring(answer))  -- FIXME
-
                output_ttl = get_http_ttl(answer)
                -- binary output
                output = ffi.string(answer.wire, answer.size)
@@ -86,7 +84,6 @@ local function serve_doh(h, stream)
        if result ~= 0 then
                return 400, 'unparseable DNS message'
        end
-       print(pkt)
 
        -- set source address so filters can work
        local function init_cb(req)
@@ -94,13 +91,11 @@ local function serve_doh(h, stream)
                req.qsource.dst_addr = convert_sockaddr(stream:localname())
                req.qsource.flags.tcp = true
                req.qsource.flags.tls = (stream.connection:checktls() ~= nil)
-               print(req.qsource.flags.tls)
                req.qsource.flags.http = true
        end
 
        -- resolve query
        worker.resolve_pkt(pkt, finish_cb, init_cb)
-       -- Wait for asynchronous query and free callbacks -- FIXME
        if not done then
                waiting = true
                cond:wait()
index 2bfe2da6662b5ac7463b03378c54aaa3429368a2..cc9d9be2da213acd5311fa748e2ed1ed12cc8da1 100644 (file)
@@ -45,7 +45,6 @@ function parse_pkt(input, desc)
 
        local result = ffi.C.knot_pkt_parse(pkt, 0)
        ok(result == 0, desc .. ': knot_pkt_parse works on received answer')
-       print(pkt)
        return pkt
 end
 
@@ -199,8 +198,6 @@ else
                local exp_dstaddr = ffi.gc(ffi.C.kr_straddr_socket(host, port), ffi.C.free)
                local function check_dstaddr(state, req)
                        triggered = true
-                       print(exp_dstaddr)
-                       print(req.qsource.dst_addr)
                        same(ffi.C.kr_sockaddr_cmp(req.qsource.dst_addr, exp_dstaddr), 0,
                                'request has correct server address')
                        return state