diff --git a/cmake-build-debug/.ninja_deps b/cmake-build-debug/.ninja_deps index 8aa5bec..622abb7 100644 Binary files a/cmake-build-debug/.ninja_deps and b/cmake-build-debug/.ninja_deps differ diff --git a/cmake-build-debug/.ninja_log b/cmake-build-debug/.ninja_log index 2168de0..316de91 100644 --- a/cmake-build-debug/.ninja_log +++ b/cmake-build-debug/.ninja_log @@ -61,3 +61,5 @@ 7369 7621 1698284653283151767 insane_dns ff5ae500893d0be1 2 2997 1698338548693635693 CMakeFiles/insane_dns.dir/src/main.cpp.o 727da43cdbc82421 2997 3087 1698338548789636298 insane_dns ff5ae500893d0be1 +5 7590 1698350638277966894 CMakeFiles/insane_dns.dir/src/main.cpp.o 727da43cdbc82421 +7590 7806 1698350638505965615 insane_dns ff5ae500893d0be1 diff --git a/cmake-build-debug/CMakeFiles/insane_dns.dir/src/main.cpp.o b/cmake-build-debug/CMakeFiles/insane_dns.dir/src/main.cpp.o index 38e0176..d21477a 100644 Binary files a/cmake-build-debug/CMakeFiles/insane_dns.dir/src/main.cpp.o and b/cmake-build-debug/CMakeFiles/insane_dns.dir/src/main.cpp.o differ diff --git a/cmake-build-debug/Testing/Temporary/LastTest.log b/cmake-build-debug/Testing/Temporary/LastTest.log index b6a4e32..9a969c3 100644 --- a/cmake-build-debug/Testing/Temporary/LastTest.log +++ b/cmake-build-debug/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Oct 26 12:42 EDT +Start testing: Oct 26 16:04 EDT ---------------------------------------------------------- -End testing: Oct 26 12:42 EDT +End testing: Oct 26 16:04 EDT diff --git a/cmake-build-debug/insane_dns b/cmake-build-debug/insane_dns index 09b73e5..17e1cee 100755 Binary files a/cmake-build-debug/insane_dns and b/cmake-build-debug/insane_dns differ diff --git a/src/main.cpp b/src/main.cpp index be98047..77cf945 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,7 +46,6 @@ static inline constexpr IPAddress REPLACEMENT_IP() */ static const std::unordered_set DISALLOWED_DOMAINS{ "en.wikipedia.org", - "tpgc.me", "zombo.com" }; @@ -107,7 +106,7 @@ class question uint16_t QTYPE; uint16_t QCLASS; public: - explicit question(const byte_reader& reader) + explicit question(const blt::byte_reader& reader) { // process the full question while (true) @@ -144,7 +143,7 @@ class answer bool requires_reset = false; unsigned char* RDATA = nullptr; public: - explicit answer(const byte_reader& reader) + explicit answer(const blt::byte_reader& reader) { reader.to(NAME); reader.to(TYPE); @@ -186,6 +185,10 @@ class answer inline void reset(size_t offset) const { + if (!requires_reset) + return; + // like I said not 100 on how to construct the ptr + // seems to be causing issues. I've stopped working on this as it's not required. auto i16 = static_cast(offset) & (~(0b11 << 14)); NAME |= i16; } @@ -195,7 +198,7 @@ class answer answer& operator=(const answer& answer) = delete; - answer(answer&& move) + answer(answer&& move) noexcept { NAME = move.NAME; TYPE = move.TYPE; @@ -206,7 +209,7 @@ class answer move.RDATA = nullptr; } - answer& operator=(answer&& move) + answer& operator=(answer&& move) noexcept { NAME = 0; NAME = move.NAME; @@ -246,9 +249,6 @@ class send_buffer { blt::mem::toBytes(t, &internal_data[write_index]); write_index += sizeof(T); - } else if constexpr (std::is_same_v) - { - static_assert("No"); } else if constexpr (std::is_same_v) { write(t.NAME); @@ -351,18 +351,18 @@ int main() uint16_t num_of_answers; blt::mem::fromBytes(&mod_recv_buf[6], num_of_answers); - byte_reader reader2(mod_recv_buf.data(), mod_recv_buf.size()); + blt::byte_reader reader(mod_recv_buf.data(), mod_recv_buf.size()); BLT_INFO("Bytes answered %d with %d answers", out_bytes, num_of_answers); // no one actually does multiple questions. trying to do it in dig is not easy // and the standard isn't really designed for this (how do we handle if one question errors but the other doesn't? there is only // one return code.) - question q(reader2); + question q(reader); std::vector answers; for (int i = 0; i < num_of_answers; i++) { - answer a(reader2); + answer a(reader); answers.push_back(std::move(a)); } @@ -387,7 +387,7 @@ int main() a.reset(question_offset); send.write(a); } - send.write(reader2.from(), out_bytes - reader2.last()); + send.write(reader.from(), out_bytes - reader.last()); asio::error_code ignored_error; socket.send_to(send.buffer(), remote_endpoint, 0, ignored_error);