From 91d35164e4f9c37a7489804ed1ac506bbe1e5e46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20=C5=A0pa=C4=8Dek?= <petr.spacek@nic.cz>
Date: Wed, 3 Apr 2019 16:29:17 +0200
Subject: [PATCH] doh: remove devel output

---
 daemon/bindings/worker.c       | 37 ----------------------------------
 modules/http/http_doh.lua      |  5 -----
 modules/http/http_doh.test.lua |  3 ---
 3 files changed, 45 deletions(-)

diff --git a/daemon/bindings/worker.c b/daemon/bindings/worker.c
index 7f961406e..d4761a456 100644
--- a/daemon/bindings/worker.c
+++ b/daemon/bindings/worker.c
@@ -14,46 +14,12 @@
     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);
diff --git a/modules/http/http_doh.lua b/modules/http/http_doh.lua
index 68ee3b177..5768cf821 100644
--- a/modules/http/http_doh.lua
+++ b/modules/http/http_doh.lua
@@ -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()
diff --git a/modules/http/http_doh.test.lua b/modules/http/http_doh.test.lua
index 2bfe2da66..cc9d9be2d 100644
--- a/modules/http/http_doh.test.lua
+++ b/modules/http/http_doh.test.lua
@@ -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
-- 
GitLab