diff --git a/src/RemoteSerializer.cc b/src/RemoteSerializer.cc index cc5e8c5ff9..838bafb0d6 100644 --- a/src/RemoteSerializer.cc +++ b/src/RemoteSerializer.cc @@ -700,7 +700,8 @@ RemoteSerializer::PeerID RemoteSerializer::Connect(const IPAddr& ip, const size_t BUFSIZE = 1024; char* data = new char[BUFSIZE]; - snprintf(data, BUFSIZE, "%"PRIu64",%s,%s,%"PRIu16",%"PRIu32",%d", p->id, + snprintf(data, BUFSIZE, + "%"PRI_PTR_COMPAT_UINT",%s,%s,%"PRIu16",%"PRIu32",%d", p->id, ip.AsString().c_str(), zone_id.c_str(), port, uint32(retry), use_ssl); diff --git a/src/input/Manager.cc b/src/input/Manager.cc index bc79a2390b..f35071081b 100644 --- a/src/input/Manager.cc +++ b/src/input/Manager.cc @@ -194,6 +194,7 @@ Manager::TableStream::~TableStream() Manager::Manager() { + update_finished = internal_handler("Input::update_finished"); } Manager::~Manager() @@ -1199,11 +1200,7 @@ void Manager::EndCurrentSend(ReaderFrontend* reader) #endif // Send event that the current update is indeed finished. - EventHandler* handler = event_registry->Lookup("Input::update_finished"); - if ( handler == 0 ) - reporter->InternalError("Input::update_finished not found!"); - - SendEvent(handler, 2, new StringVal(i->name.c_str()), new StringVal(i->source.c_str())); + SendEvent(update_finished, 2, new StringVal(i->name.c_str()), new StringVal(i->source.c_str())); } void Manager::Put(ReaderFrontend* reader, Value* *vals) diff --git a/src/input/Manager.h b/src/input/Manager.h index 269e562e23..400918366e 100644 --- a/src/input/Manager.h +++ b/src/input/Manager.h @@ -184,6 +184,8 @@ private: enum StreamType { TABLE_STREAM, EVENT_STREAM }; map readers; + + EventHandlerPtr update_finished; };