Skip to content

Commit 8bb4864

Browse files
committed
Allow transfer requests only one at a time
Signed-off-by: Mateusz Szczygieł <[email protected]>
1 parent a6e2eda commit 8bb4864

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Add `connection_retries` config parameter
99
* Add `TransferDeffered` event indicating the connection to peer couldn't be establish at this time
1010
* Disallow downloading file for which any path component is larger than 250 characters
11+
* Fix ocassional missing of `TransferPaused` event when toggling libdrop on and off quickly
1112

1213
---
1314
<br>

drop-transfer/src/manager.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ impl TransferManager {
131131
drop(conn)
132132
}
133133
_ => {
134+
if let Some(conn) = &state.conn {
135+
if !conn.is_closed() {
136+
anyhow::bail!("The transfer connection is in progress already");
137+
}
138+
}
139+
134140
info!(self.logger, "Issuing pending requests for: {}", xfer.id());
135141
state.issue_pending_requests(&conn, &self.logger);
136142
state.conn = Some(conn);

0 commit comments

Comments
 (0)