Permalink
Browse files

Map qclass from ret correctly to Lua

  • Loading branch information...
1 parent 09425ce commit f94c53dc0e48e4bed9de48b90ad48b08e58dcd19 @Fusl Fusl committed Jan 25, 2014
Showing with 9 additions and 0 deletions.
  1. +9 −0 pdns/lua-pdns.cc
View
@@ -108,6 +108,9 @@ void pushResourceRecordsTable(lua_State* lua, const vector<DNSResourceRecord>& r
lua_pushnumber(lua, rr.d_place);
lua_setfield(lua, -2, "place");
+ lua_pushnumber(lua, rr.qclass);
+ lua_setfield(lua, -2, "qclass");
+
lua_settable(lua, -3); // pushes the table we just built into the master table at position pushed above
}
}
@@ -196,6 +199,12 @@ void popResourceRecordsTable(lua_State *lua, const string &query, vector<DNSReso
rr.d_place = DNSResourceRecord::ADDITIONAL;
}
+ if(!getFromTable(lua, "qclass", tmpnum))
+ rr.qclass = QClass::IN;
+ else {
+ rr.qclass = tmpnum;
+ }
+
/* removes 'value'; keeps 'key' for next iteration */
lua_pop(lua, 1); // table

0 comments on commit f94c53d

Please sign in to comment.