]> granicus.if.org Git - pdns/commitdiff
silence some output to standard error in our lua scripts for the recursors (?!),...
authorBert Hubert <bert.hubert@netherlabs.nl>
Fri, 9 Nov 2012 19:57:25 +0000 (19:57 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Fri, 9 Nov 2012 19:57:25 +0000 (19:57 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2879 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/lua-pdns.cc

index ae556b987fad6f6497862b0856f560aeb462f547..26c7630f2a555681c23a8a0ff0801d87f713f5fd 100644 (file)
@@ -119,13 +119,13 @@ void popResourceRecordsTable(lua_State *lua, const string &query, vector<DNSReso
   rr.d_place = DNSResourceRecord::ANSWER;
   rr.ttl = 3600;
 
-  cerr<<"Lua stacksize "<<lua_gettop(lua)<<endl;
+//  cerr<<"Lua stacksize "<<lua_gettop(lua)<<endl;
 #ifndef LUA_VERSION_NUM
   int tableLen = luaL_getn(lua, 2);
 #else
   int tableLen = lua_objlen(lua, 2);
 #endif
-  cerr<<"Got back "<<tableLen<< " answers from Lua"<<endl;
+//  cerr<<"Got back "<<tableLen<< " answers from Lua"<<endl;
 
   for(int n=1; n < tableLen + 1; ++n) {
     lua_pushnumber(lua, n);
@@ -146,8 +146,11 @@ void popResourceRecordsTable(lua_State *lua, const string &query, vector<DNSReso
 
     if(!getFromTable(lua, "place", tmpnum))
       rr.d_place = DNSResourceRecord::ANSWER;
-    else
+    else {
       rr.d_place = (DNSResourceRecord::Place) tmpnum;
+      if(rr.d_place > DNSResourceRecord::ADDITIONAL)
+        rr.d_place = DNSResourceRecord::ADDITIONAL;
+    }
 
     /* removes 'value'; keeps 'key' for next iteration */
     lua_pop(lua, 1); // table