From: Marcin Siodelski Date: Thu, 8 Nov 2018 13:22:05 +0000 (+0100) Subject: [#42, !103] Addressed two review comments. X-Git-Tag: Kea-1.5.0-beta1~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2F42-congestion-handler-exp-1;p=thirdparty%2Fkea.git [#42, !103] Addressed two review comments. Commentary for sleep(1) in case of the error condition in the IfaceMgr. Also fixed one parameter name in the doxygen. --- diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc index 044fbb6081..8792b216e6 100644 --- a/src/lib/dhcp/iface_mgr.cc +++ b/src/lib/dhcp/iface_mgr.cc @@ -1221,6 +1221,9 @@ void IfaceMgr::receiveDHCP4Packets() { // Signal the error to receive4. receiver_error_ = strerror(errno); error_watch_.markReady(); + // We need to sleep in case of the error condition to + // prevent the thread from tight looping when result + // gets negative. sleep(1); } continue; @@ -1303,6 +1306,9 @@ void IfaceMgr::receiveDHCP6Packets() { // Signal the error to receive6. receiver_error_ = strerror(errno); error_watch_.markReady(); + // We need to sleep in case of the error condition to + // prevent the thread from tight looping when result + // gets negative. sleep(1); } continue; diff --git a/src/lib/dhcp/packet_queue.h b/src/lib/dhcp/packet_queue.h index 32e2c4a95c..0d33a4ef26 100644 --- a/src/lib/dhcp/packet_queue.h +++ b/src/lib/dhcp/packet_queue.h @@ -234,7 +234,7 @@ public: /// @brief Constructor /// /// @param queue_type logical name of the queue implementation - /// @param queue_capacity maximum number of packets the queue can hold + /// @param capacity maximum number of packets the queue can hold PacketQueueRing(const std::string& queue_type, size_t capacity) : PacketQueue(queue_type) { queue_.set_capacity(capacity);