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
emulab
emulab-devel
Commits
41ca8e25
Commit
41ca8e25
authored
Sep 06, 2006
by
Robert Ricci
Browse files
Don't report a new value if the new one would be the same as the old
parent
241974a4
Changes
2
Show whitespace changes
Inline
Side-by-side
pelab/magent/MinDelaySensor.cc
View file @
41ca8e25
...
...
@@ -8,7 +8,7 @@
using
namespace
std
;
MinDelaySensor
::
MinDelaySensor
(
DelaySensor
*
newDelay
)
:
minimum
(
1000000
,
-
0.01
),
minDelay
(
1000000
)
:
minimum
(
1000000
,
-
0.01
),
minDelay
(
1000000
)
,
lastreported
(
-
1
)
{
delay
=
newDelay
;
}
...
...
@@ -20,16 +20,18 @@ void MinDelaySensor::localSend(PacketInfo *)
void
MinDelaySensor
::
localAck
(
PacketInfo
*
packet
)
{
int
current
=
delay
->
getLastDelay
();
if
(
current
<
minimum
&&
current
!=
0
)
int
oneway
=
current
/
2
;
if
(
current
<
minimum
&&
current
!=
0
&&
oneway
!=
lastreported
)
{
minDelay
=
current
;
ostringstream
buffer
;
buffer
<<
"delay="
<<
minDelay
/
2
;
buffer
<<
"delay="
<<
oneway
;
minimum
.
reset
(
current
);
global
::
output
->
eventMessage
(
buffer
.
str
(),
packet
->
elab
,
CommandOutput
::
FORWARD_PATH
);
global
::
output
->
eventMessage
(
buffer
.
str
(),
packet
->
elab
,
CommandOutput
::
BACKWARD_PATH
);
lastreported
=
oneway
;
}
else
{
...
...
pelab/magent/MinDelaySensor.h
View file @
41ca8e25
...
...
@@ -24,6 +24,7 @@ private:
Decayer
minimum
;
DelaySensor
*
delay
;
int
minDelay
;
int
lastreported
;
};
#endif
...
...
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