Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
bwmtools
bwmtools
Commits
edcd553a
Commit
edcd553a
authored
Jan 19, 2005
by
Nigel Kukard
Browse files
* Fixed some comments & small code cleanup
parent
2cb4135f
Changes
1
Hide whitespace changes
Inline
Side-by-side
bwmd/flow.c
View file @
edcd553a
...
...
@@ -186,7 +186,7 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
// 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
);
...
...
@@ -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
)
{
struct
timeval
curTime
;
...
...
@@ -381,7 +383,7 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
// Lock everything
g_mutex_lock
(
nextPktQueue
->
lock
);
g_mutex_lock
(
flow
->
lock
);
// A
dd packet
to parent
queue & remove from child
// A
ppend
to parent
nextPktQueue
->
packets
=
g_list_append
(
nextPktQueue
->
packets
,
packet
);
// Update next queue stats
nextPktQueue
->
curLen
++
;
...
...
@@ -417,7 +419,9 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
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 @@ static int processPktQueue(struct runnerData_t *runnerData, struct pktQueue_t *p
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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment