Fix broker data stores in absence of --enable-debug.

Oops, put too much inside the assert() macro, so the registering of data
stores got preprocessed out of optimized builds.
This commit is contained in:
Jon Siwek 2015-03-10 13:22:39 -05:00
parent 867c4379ea
commit cb5902d1ad
5 changed files with 18 additions and 5 deletions

View file

@ -1,4 +1,8 @@
2.3-530 | 2015-03-10 13:22:39 -0500
* Fix broker data stores in absence of --enable-debug. (Jon Siwek)
2.3-529 | 2015-03-09 13:14:27 -0500
* Fix format specifier in SSL protocol violation. (Jon Siwek)

View file

@ -1 +1 @@
2.3-529
2.3-530

@ -1 +1 @@
Subproject commit 694af9d9edd188a461cc762bfdb7b61688b93ada
Subproject commit 1a49b0e3d23fdfe8da3187dddb310883b641e4a3

View file

@ -1038,6 +1038,7 @@ bool bro_broker::Manager::CloseStore(const broker::store::identifier& id,
delete it->second->store;
it->second->store = nullptr;
Unref(it->second);
data_stores.erase(it);
return true;
}

View file

@ -48,7 +48,8 @@ function BrokerStore::create_master%(id: string, b: BackendType &default = MEMOR
rval = new bro_broker::StoreHandleVal(id_str, type,
static_cast<BifEnum::BrokerStore::BackendType>(b->AsEnum()),
options->AsRecordVal());
assert(broker_mgr->AddStore(rval));
auto added = broker_mgr->AddStore(rval);
assert(added);
return rval;
%}
@ -92,7 +93,8 @@ function BrokerStore::create_clone%(id: string, b: BackendType &default = MEMORY
static_cast<BifEnum::BrokerStore::BackendType>(b->AsEnum()),
options->AsRecordVal(),
std::chrono::duration<double>(resync));
assert(broker_mgr->AddStore(rval));
auto added = broker_mgr->AddStore(rval);
assert(added);
return rval;
%}
@ -115,7 +117,8 @@ function BrokerStore::create_frontend%(id: string%): opaque of BrokerStore::Hand
}
rval = new bro_broker::StoreHandleVal(id_str, type, {}, nullptr);
assert(broker_mgr->AddStore(rval));
auto added = broker_mgr->AddStore(rval);
assert(added);
return rval;
%}
@ -396,7 +399,12 @@ static bool prepare_for_query(Val* opaque, Frame* frame,
*handle = static_cast<bro_broker::StoreHandleVal*>(opaque);
if ( ! (*handle)->store )
{
reporter->PushLocation(frame->GetCall()->GetLocationInfo());
reporter->Error("BrokerStore query has an invalid data store");
reporter->PopLocation();
return false;
}
Trigger* trigger = frame->GetTrigger();