Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
PRRT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
37
Issues
37
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LARN
PRRT
Commits
e73683dc
Commit
e73683dc
authored
Dec 05, 2019
by
Marlene Böhmer
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check timeout on delivery
parent
3063e8bc
Pipeline
#4333
failed with stages
in 27667 minutes and 16 seconds
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
prrt/proto/stores/packetDeliveryStore.c
prrt/proto/stores/packetDeliveryStore.c
+24
-14
No files found.
prrt/proto/stores/packetDeliveryStore.c
View file @
e73683dc
...
...
@@ -99,22 +99,32 @@ PrrtPacket *PrrtPacketDeliveryStore_get_packet_timedwait(PrrtPacketDeliveryStore
PrrtPacket
*
PrrtPacketDeliveryStore_get_packet
(
PrrtPacketDeliveryStore
*
store
,
prrtTimestamp_t
start
,
prrtTimestamp_t
stop
)
{
PrrtPacket
*
packet
=
NULL
;
bool
timed_out
;
check
(
pthread_mutex_lock
(
&
store
->
lock
)
==
EXIT_SUCCESS
,
"Lock failed."
);
if
(
start
>
stop
)
{
packet
=
BPTree_get_first_in_range
(
store
->
tree
,
(
BPTreeKey_t
)
start
,
TIMESTAMP_SPACE
-
1
);
if
(
packet
==
NULL
)
{
packet
=
BPTree_get_first_in_range
(
store
->
tree
,
0
,
(
BPTreeKey_t
)
stop
);
do
{
timed_out
=
false
;
if
(
start
>
stop
)
{
packet
=
BPTree_get_first_in_range
(
store
->
tree
,
(
BPTreeKey_t
)
start
,
TIMESTAMP_SPACE
-
1
);
if
(
packet
==
NULL
)
{
packet
=
BPTree_get_first_in_range
(
store
->
tree
,
0
,
(
BPTreeKey_t
)
stop
);
}
}
else
{
packet
=
BPTree_get_first_in_range
(
store
->
tree
,
(
BPTreeKey_t
)
start
,
(
BPTreeKey_t
)
stop
);
}
}
else
{
packet
=
BPTree_get_first_in_range
(
store
->
tree
,
(
BPTreeKey_t
)
start
,
(
BPTreeKey_t
)
stop
);
}
if
(
packet
!=
NULL
)
{
store
->
tree
=
BPTree_delete
(
store
->
tree
,
PrrtDataPacket_packet_timeout
(
packet
));
}
if
(
packet
!=
NULL
)
{
store
->
tree
=
BPTree_delete
(
store
->
tree
,
PrrtDataPacket_packet_timeout
(
packet
));
prrtTimestamp_t
now
=
PrrtClock_get_current_time_us
();
if
(
PrrtTimestamp_cmp
(
now
,
PrrtDataPacket_packet_timeout
(
packet
))
>
0
)
{
timed_out
=
true
;
PrrtPacket_destroy
(
packet
);
packet
=
NULL
;
}
}
}
while
(
timed_out
);
check
(
pthread_mutex_unlock
(
&
store
->
lock
)
==
EXIT_SUCCESS
,
"Unlock failed."
);
return
packet
;
...
...
Andreas Schmidt
@as
mentioned in issue
#41 (closed)
·
Jan 14, 2020
mentioned in issue
#41 (closed)
mentioned in issue #41
Toggle commit list
Write
Preview
Markdown
is supported
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