[bwm-tools-devel] COMMIT - r51 - trunk/bwmd
Brought to you by:
nkukard
From: SVN C. <sv...@li...> - 2005-01-19 18:26:43
|
Author: nkukard Date: 2005-01-19 20:26:32 +0200 (Wed, 19 Jan 2005) New Revision: 51 Modified: trunk/bwmd/flow.c Log: * Fixed some comments & small code cleanup Modified: trunk/bwmd/flow.c =================================================================== --- trunk/bwmd/flow.c 2005-01-19 18:26:08 UTC (rev 50) +++ trunk/bwmd/flow.c 2005-01-19 18:26:32 UTC (rev 51) @@ -186,8 +186,8 @@ // Differences in queue when we done int acceptLen = 0, queuedLen = 0; int acceptSize = 0, queuedSize = 0; + - // Lock, hijack packets, unlock g_mutex_lock(pktQueue->lock); packets = pktQueue->packets; @@ -286,7 +286,9 @@ } } - // 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) { struct timeval curTime; @@ -381,7 +383,7 @@ // Lock everything g_mutex_lock(nextPktQueue->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); // Update next queue stats nextPktQueue->curLen++; @@ -417,7 +419,9 @@ g_mutex_lock(pktQueue->lock); if (packets) { + // Merge the rest in pktQueue->packets = g_list_concat(packets,pktQueue->packets); + // Signal that we just added to the queue g_mutex_lock(runnerData->bandSignalLock); // Check if we havn't already gotten the queue listed @@ -427,12 +431,13 @@ g_cond_signal(runnerData->bandSignalCond); g_mutex_unlock(runnerData->bandSignalLock); } + pktQueue->curLen -= (acceptLen + queuedLen); pktQueue->curSize -= (acceptSize + queuedLen); g_mutex_unlock(pktQueue->lock); - return(acceptLen); + return acceptLen; } |