Fixed networking flush algorithm for the file transfer

This commit is contained in:
WolverinDEV
2020-06-11 13:08:45 +02:00
parent 6e1323cc23
commit cbb0bd6864
5 changed files with 136 additions and 129 deletions
+5 -16
View File
@@ -28,22 +28,11 @@ void transfer::free_buffer(Buffer* buffer) {
}
FileClient::~FileClient() {
{
auto head = this->network_buffer.buffer_head;
while (head) {
auto next = head->next;
free_buffer(head);
head = next;
}
}
{
auto head = this->disk_buffer.buffer_head;
while (head) {
auto next = head->next;
free_buffer(head);
head = next;
}
}
this->flush_network_buffer();
this->flush_disk_buffer();
assert(!this->disk_buffer.buffer_head);
assert(!this->network_buffer.buffer_head);
assert(!this->file.file_descriptor);
assert(!this->file.currently_processing);