Skip to content

Commit

Permalink
Merge pull request #123 from ikatson/dev
Browse files Browse the repository at this point in the history
Bugfix: on 32 bit systems files > 4gb
  • Loading branch information
ikatson authored Apr 23, 2024
2 parents a881c1c + 136e8fb commit 0fd7b42
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ release-linux-current-target:
cargo build --profile release-github --target=$(TARGET) --features=openssl-vendored

@PHONY: release-linux
release-linux: release-linux-x86_64 release-linux-aarch64 release-linux-armv6 release-linux-armv7
release-linux: release-linux-x86_64 release-linux-aarch64 release-linux-armv6 release-linux-armv7 release-linux-armv7-musl

@PHONY: release-linux-x86_64
release-linux-x86_64:
Expand Down Expand Up @@ -105,6 +105,14 @@ release-linux-armv7:
CROSS_COMPILE_PREFIX=armv7-linux-gnueabihf \
$(MAKE) release-linux-current-target

@PHONY: release-linux-armv7-musl
release-linux-armv7-musl:
TARGET=armv7-unknown-linux-musleabihf \
TARGET_SNAKE_CASE=armv7_unknown_linux_musleabihf \
TARGET_SNAKE_UPPER_CASE=ARMV7_UNKNOWN_LINUX_MUSLEABIHF \
CROSS_COMPILE_PREFIX=armv7-linux-musleabihf \
$(MAKE) release-linux-current-target


@PHONY: release-all
release-all: release-windows release-linux release-macos-universal
Expand Down
2 changes: 1 addition & 1 deletion crates/librqbit/src/file_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ impl<'a> FileOps<'a> {
}

let remaining_len = file_len - absolute_offset;
let to_write = std::cmp::min(buf.len(), remaining_len as usize);
let to_write = std::cmp::min(buf.len() as u64, remaining_len) as usize;

let mut file_g = self.files[file_idx].file.lock();
trace!(
Expand Down
12 changes: 10 additions & 2 deletions crates/librqbit/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,11 @@ impl Session {

let peer_rx = self.make_peer_rx(
info_hash,
magnet.trackers.clone(),
if opts.disable_trackers {
Default::default()
} else {
magnet.trackers.clone()
},
announce_port,
opts.force_tracker_interval,
)?;
Expand Down Expand Up @@ -897,7 +901,11 @@ impl Session {
} else {
self.make_peer_rx(
torrent.info_hash,
trackers.clone(),
if opts.disable_trackers {
Default::default()
} else {
trackers.clone()
},
announce_port,
opts.force_tracker_interval,
)?
Expand Down

0 comments on commit 0fd7b42

Please sign in to comment.