Commit e8230546 authored by Razvan Becheriu's avatar Razvan Becheriu

[#892] fixed compilation

parent 1d32ebae
......@@ -1221,9 +1221,10 @@ Dhcpv4Srv::processPacket(Pkt4Ptr& query, Pkt4Ptr& rsp, bool allow_packet_park) {
HooksManager::park("leases4_committed", query,
[this, callout_handle, query, rsp]() mutable {
if (Dhcpv4Srv::threadCount()) {
ThreadPool::WorkItemCallBack call_back =
std::bind(&Dhcpv4Srv::processPacketSendResponseNoThrow,
this, callout_handle, query, rsp);
typedef function<void()> CallBack;
boost::shared_ptr<CallBack> call_back =
boost::make_shared<CallBack>(std::bind(&Dhcpv4Srv::sendResponseNoThrow,
this, callout_handle, query, rsp));
pkt_thread_pool_.add(call_back);
} else {
processPacketPktSend(callout_handle, query, rsp);
......@@ -1242,8 +1243,8 @@ Dhcpv4Srv::processPacket(Pkt4Ptr& query, Pkt4Ptr& rsp, bool allow_packet_park) {
}
void
Dhcpv4Srv::processPacketSendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
Pkt4Ptr& query, Pkt4Ptr& rsp) {
Dhcpv4Srv::sendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
Pkt4Ptr& query, Pkt4Ptr& rsp) {
try {
processPacketPktSend(callout_handle, query, rsp);
processPacketBufferSend(callout_handle, rsp);
......
......@@ -307,6 +307,14 @@ public:
/// @param rsp A pointer to the response
void processPacketAndSendResponseNoThrow(Pkt4Ptr& query, Pkt4Ptr& rsp);
/// @brief Process an unparked DHCPv4 packet and sends the response.
///
/// @param callout_handle pointer to the callout handle.
/// @param query A pointer to the packet to be processed.
/// @param rsp A pointer to the response
void sendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
Pkt4Ptr& query, Pkt4Ptr& rsp);
/// @brief Process a single incoming DHCPv4 packet.
///
/// It verifies correctness of the passed packet, call per-type processXXX
......@@ -986,7 +994,6 @@ protected:
void processPacketBufferSend(hooks::CalloutHandlePtr& callout_handle,
Pkt4Ptr& rsp);
private:
/// @public
......
......@@ -980,9 +980,10 @@ Dhcpv6Srv::processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp) {
HooksManager::park("leases6_committed", query,
[this, callout_handle, query, rsp]() mutable {
if (Dhcpv6Srv::threadCount()) {
ThreadPool::WorkItemCallBack call_back =
std::bind(&Dhcpv6Srv::processPacketSendResponseNoThrow,
this, callout_handle, query, rsp);
typedef function<void()> CallBack;
boost::shared_ptr<CallBack> call_back =
boost::make_shared<CallBack>(std::bind(&Dhcpv6Srv::sendResponseNoThrow,
this, callout_handle, query, rsp));
pkt_thread_pool_.add(call_back);
} else {
processPacketPktSend(callout_handle, query, rsp);
......@@ -1001,8 +1002,8 @@ Dhcpv6Srv::processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp) {
}
void
Dhcpv6Srv::processPacketSendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
Pkt6Ptr& query, Pkt6Ptr& rsp) {
Dhcpv6Srv::sendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
Pkt6Ptr& query, Pkt6Ptr& rsp) {
try {
processPacketPktSend(callout_handle, query, rsp);
processPacketBufferSend(callout_handle, rsp);
......
......@@ -174,6 +174,14 @@ public:
/// @param rsp A pointer to the response
void processPacketAndSendResponseNoThrow(Pkt6Ptr& query, Pkt6Ptr& rsp);
/// @brief Process an unparked DHCPv6 packet and sends the response.
///
/// @param callout_handle pointer to the callout handle.
/// @param query A pointer to the packet to be processed.
/// @param rsp A pointer to the response
void sendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
Pkt6Ptr& query, Pkt6Ptr& rsp);
/// @brief Process a single incoming DHCPv6 packet.
///
/// It verifies correctness of the passed packet, call per-type processXXX
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment