Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
PRRT
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
26
Issues
26
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LARN
PRRT
Commits
ca82a6e9
Commit
ca82a6e9
authored
Aug 03, 2018
by
Andreas Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Packets in deliveryStore also expire.
parent
f37eff7b
Pipeline
#2790
passed with stages
in 1 minute and 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
prrt/proto/socket.c
prrt/proto/socket.c
+3
-3
prrt/proto/stores/packetDeliveryStore.c
prrt/proto/stores/packetDeliveryStore.c
+16
-0
prrt/proto/stores/packetDeliveryStore.h
prrt/proto/stores/packetDeliveryStore.h
+2
-0
No files found.
prrt/proto/socket.c
View file @
ca82a6e9
...
...
@@ -465,9 +465,8 @@ PrrtCodingConfiguration *PrrtSocket_get_coding_parameters(PrrtSocket *s) {
bool
PrrtSocket_cleanup
(
PrrtSocket
*
s
)
{
debug
(
DEBUG_CLEANUP
,
"PrrtSocket_cleanup"
);
if
(
s
->
packetTimeoutTable
!=
NULL
)
{
List
*
expired_packets
=
PrrtPacketTimeoutTable_expire_packets
(
s
->
packetTimeoutTable
,
PrrtClock_get_prrt_time_us
(
&
s
->
clock
));
prrtTimestamp_t
now
=
PrrtClock_get_current_time_us
();
List
*
expired_packets
=
PrrtPacketTimeoutTable_expire_packets
(
s
->
packetTimeoutTable
,
now
);
uint32_t
expired_count
=
List_count
(
expired_packets
);
debug
(
DEBUG_CLEANUP
,
"EXPIRED"
);
if
(
expired_count
>
0
)
{
...
...
@@ -498,6 +497,7 @@ bool PrrtSocket_cleanup(PrrtSocket *s) {
PrrtPacketTimeout
*
packetTimeout
=
(
PrrtPacketTimeout
*
)
List_shift
(
expired_packets
);
PrrtPacketTimeout_destroy
(
packetTimeout
);
}
PrrtPacketDeliveryStore_cleanup
(
s
->
packetDeliveryStore
,
now
);
}
List_destroy
(
expired_packets
);
}
...
...
prrt/proto/stores/packetDeliveryStore.c
View file @
ca82a6e9
...
...
@@ -163,3 +163,19 @@ bool PrrtPacketDeliveryStore_insert(PrrtPacketDeliveryStore *store, PrrtPacket *
PERROR
(
"Insert failed%s."
,
""
);
return
false
;
}
void
PrrtPacketDeliveryStore_cleanup
(
PrrtPacketDeliveryStore
*
store
,
prrtTimestamp_t
now
)
{
List
*
packetList
=
List_create
();
if
(
now
>=
TIMESTAMP_SPACE
/
2
)
{
BPTree_get_range
(
store
->
tree
,
packetList
,
now
-
TIMESTAMP_SPACE
/
2
,
now
);
}
else
{
BPTree_get_range
(
store
->
tree
,
packetList
,
0
,
now
);
BPTree_get_range
(
store
->
tree
,
packetList
,
now
+
TIMESTAMP_SPACE
/
2
,
TIMESTAMP_SPACE
);
}
while
(
List_count
(
packetList
)
>
0
)
{
PrrtPacket
*
block
=
List_shift
(
packetList
);
store
->
tree
=
BPTree_delete
(
store
->
tree
,
block
->
sequenceNumber
);
PrrtPacket_destroy
(
block
);
}
List_destroy
(
packetList
);
}
\ No newline at end of file
prrt/proto/stores/packetDeliveryStore.h
View file @
ca82a6e9
...
...
@@ -25,6 +25,8 @@ PrrtPacket *PrrtPacketDeliveryStore_get_packet_timedwait(PrrtPacketDeliveryStore
bool
PrrtPacketDeliveryStore_insert
(
PrrtPacketDeliveryStore
*
store
,
PrrtPacket
*
packet
);
void
PrrtPacketDeliveryStore_cleanup
(
PrrtPacketDeliveryStore
*
store
,
prrtTimestamp_t
now
);
void
PrrtPacketDeliveryStore_interrupt
(
PrrtPacketDeliveryStore
*
store
);
bool
PrrtPacketDeliveryStore_destroy
(
PrrtPacketDeliveryStore
*
store
);
...
...
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