Add ddl checksums
This commit is contained in:
parent
7052ef8407
commit
bddac6209d
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user