Deliver notifications to registered clients

The notifications were delivered to all clients regardless of the
registration state.
This commit is contained in:
Markus Mäkelä 2019-09-25 10:20:28 +03:00
parent bcf26fba3e
commit 117e2e7e88
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -246,7 +246,10 @@ void AvroSession::queue_client_callback()
{
auto worker = static_cast<mxs::RoutingWorker*>(dcb->owner);
worker->execute([this]() {
client_callback();
if (state == AVRO_CLIENT_REQUEST_DATA)
{
client_callback();
}
}, mxs::RoutingWorker::EXECUTE_QUEUED);
}
@ -690,6 +693,8 @@ static std::string get_next_filename(std::string file, std::string dir)
void AvroSession::client_callback()
{
mxb_assert(state == AVRO_CLIENT_REQUEST_DATA);
if (last_sent_pos == 0)
{
// TODO: Don't use DCB callbacks to stream the data