Commit edcd553a authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Fixed some comments & small code cleanup

parent 2cb4135f
...@@ -186,7 +186,7 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p ...@@ -186,7 +186,7 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
// Differences in queue when we done // Differences in queue when we done
int acceptLen = 0, queuedLen = 0; int acceptLen = 0, queuedLen = 0;
int acceptSize = 0, queuedSize = 0; int acceptSize = 0, queuedSize = 0;
// Lock, hijack packets, unlock // Lock, hijack packets, unlock
g_mutex_lock(pktQueue->lock); g_mutex_lock(pktQueue->lock);
...@@ -286,7 +286,9 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p ...@@ -286,7 +286,9 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
} }
} }
// If packet is still ok to pass through, do our stuff /* If packet is still ok to pass through
* Update our parent threshold stuff so we can calculate parent_th above
*/
if (ok) if (ok)
{ {
struct timeval curTime; struct timeval curTime;
...@@ -381,7 +383,7 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p ...@@ -381,7 +383,7 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
// Lock everything // Lock everything
g_mutex_lock(nextPktQueue->lock); g_mutex_lock(nextPktQueue->lock);
g_mutex_lock(flow->lock); g_mutex_lock(flow->lock);
// Add packet to parent queue & remove from child // Append to parent
nextPktQueue->packets = g_list_append(nextPktQueue->packets,packet); nextPktQueue->packets = g_list_append(nextPktQueue->packets,packet);
// Update next queue stats // Update next queue stats
nextPktQueue->curLen++; nextPktQueue->curLen++;
...@@ -417,7 +419,9 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p ...@@ -417,7 +419,9 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
g_mutex_lock(pktQueue->lock); g_mutex_lock(pktQueue->lock);
if (packets) if (packets)
{ {
// Merge the rest in
pktQueue->packets = g_list_concat(packets,pktQueue->packets); pktQueue->packets = g_list_concat(packets,pktQueue->packets);
// Signal that we just added to the queue // Signal that we just added to the queue
g_mutex_lock(runnerData->bandSignalLock); g_mutex_lock(runnerData->bandSignalLock);
// Check if we havn't already gotten the queue listed // Check if we havn't already gotten the queue listed
...@@ -427,12 +431,13 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p ...@@ -427,12 +431,13 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
g_cond_signal(runnerData->bandSignalCond); g_cond_signal(runnerData->bandSignalCond);
g_mutex_unlock(runnerData->bandSignalLock); g_mutex_unlock(runnerData->bandSignalLock);
} }
pktQueue->curLen -= (acceptLen + queuedLen); pktQueue->curLen -= (acceptLen + queuedLen);
pktQueue->curSize -= (acceptSize + queuedLen); pktQueue->curSize -= (acceptSize + queuedLen);
g_mutex_unlock(pktQueue->lock); g_mutex_unlock(pktQueue->lock);
return(acceptLen); return acceptLen;
} }
......
Supports Markdown
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