Add ddl checksums

This commit is contained in:
Maurice Heumann 2023-01-03 20:24:41 +01:00
parent 7052ef8407
commit bddac6209d
2 changed files with 33 additions and 3 deletions

View File

@ -286,6 +286,24 @@ namespace demonware
}
};
class bdDDLChecksumResult final : public bdTaskResult
{
public:
std::string checksum{};
bool checksum_matched{};
void serialize(byte_buffer* buffer) override
{
buffer->write_string(this->checksum);
buffer->write_bool(this->checksum_matched);
}
void deserialize(byte_buffer* buffer) override
{
buffer->read_string(&this->checksum);
}
};
struct bdSockAddr final
{
bdSockAddr() : in_un(), m_family(AF_INET)

View File

@ -8,10 +8,22 @@ namespace demonware
this->register_task(1, &bdDDL::idk);
}
void bdDDL::idk(service_server* server, byte_buffer* /*buffer*/) const
void bdDDL::idk(service_server* server, byte_buffer* buffer) const
{
// TODO: Read data as soon as needed
auto reply = server->create_reply(this->task_id());
uint32_t count;
buffer->read_uint32(&count);
const auto reply = server->create_reply(this->task_id());
for (uint32_t i = 0; i < count; i++)
{
auto* checksum = new bdDDLChecksumResult;
checksum->deserialize(buffer);
checksum->checksum_matched = true;
reply->add(checksum);
}
reply->send();
}
}