Commit Graph
1385 Commits
Author SHA1 Message Date
zzz 83e4f326f9 i2psnark: Fix file priorities lost after startup check (GH #170) 2026-09-19 09:24:49 -04:00
zzz 1717ec6656 i2psnark: Limit max reported peers
to protect against tracker bugs
2026-09-16 06:23:53 -04:00
zzz f3a062ed58 i2psnark: Extend keepalive interval
from 30 to 60s, only send on inactivity
2026-09-15 12:28:37 -04:00
zzz e2026a25d5 i2psnark: Add all trackers to magnet links 2026-09-13 13:42:37 -04:00
zzz 6ce31b3424 i2psnark: Set next announce based on last response time
not request time, so failures get retried faster
2026-09-13 11:57:11 -04:00
zzz 402641a20e i2psnark: Change backup tracker to UDP
and add to tracker list
2026-09-13 11:27:43 -04:00
zzz 3f17761c86 i2psnark: Restore 2-arg getNameAndInfoHash()
used by i2psnark-rpc plugin
2026-09-09 15:00:39 -04:00
zzz 2f0fb93e83 i2psnark: Request throttle adjustments
recent changes put us well over the limits;
allow maxPipeline to go to zero again,
and remove the 10% higher request limit.
2026-09-09 14:21:38 -04:00
zzz 78529310ff i2psnark: Use uppercase for infohash in magnet names 2026-09-08 14:40:34 -04:00
zzz b12dfad938 i2psnark: Improve path traversal checks part 3
Remove check for / in name in MetaInfo throwing exception,
now handled gracefully in Storage
2026-09-08 13:51:38 -04:00
zzz 0d801ffc99 i2psnark: Improve path traversal checks part 2
Reported by: haoxucu
2026-09-04 10:34:41 -04:00
zzz b6ce258986 i2psnark: Improve path traversal checks
Reported by: haoxucu
2026-09-04 09:51:50 -04:00
zzz 641f06f48d i2psnark: Catch unbounded bdecode recursion
BDecoder applies no recursion limit to untrusted bencode,
so a large nested list or map produces a StackOverflowError
that passes through every catch(Exception) guard on the receive path
and terminates the shared I2P session dispatcher thread.

Fix by declaring and catching Throwable everywhere.

Reported by: haoxucu
2026-09-04 08:07:23 -04:00
zzz 2c3fd2a953 i2psnark: Add js audio playlist controls
resurrected and completed from snark-playlist branch (2024)
2026-09-02 15:01:38 -04:00
zzz 10a804a988 i2psnark: Build fix from previous checkin,
prep for js
2026-09-02 13:24:29 -04:00
zzz 7ed03f4f0d i2psnark: Increase min completion for audio preview 2026-09-02 11:12:02 -04:00
zzz 2b78495abf i2psnark: Add loading directives for HTML 5 elements 2026-09-02 08:18:27 -04:00
zzz 094624f099 i2psnark: Stop FetchAndAdd if not enough space 2026-09-01 11:32:32 -04:00
zzz d34dbd106f i2psnark: Check available space when adding torrent files 2026-09-01 10:57:44 -04:00
zzz 0a1a95709c i2psnark: Send sorted dictionaries in extensions as required by spec 2026-08-31 18:39:32 -04:00
zzz b06f550843 i2psnark: Check available disk space when magnet has xl param 2026-08-31 18:07:32 -04:00
zzz ec491969a1 i2psnark: Don't NPE on missing map in extension handshake 2026-08-31 17:35:40 -04:00
zzz 00cf0d2eed i2psnark: Clip long magnet links on details page 2026-08-29 13:45:47 -04:00
zzz d4db8fbb50 i2psnark: Validation fix for UDP URLs without a path part 2
and remove ancient "i2p" hostname check
2026-08-29 11:33:53 -04:00
zzz d5ba2e7ddc i2psnark: Default tracker type to open on add tracker form 2026-08-29 08:18:48 -04:00
zzz 1df04c927a i2psnark: Show free disk space on add torrent form 2026-08-29 07:23:11 -04:00
zzz 345c228129 i2psnark: Allow adding udp tracker URLs without a path on config form 2026-08-28 17:51:58 -04:00
zzz bb6d329279 i2snark: Show all magnet link trackers on details page after
transition out of magnet mode. Part 3/3
2026-08-28 15:55:42 -04:00
zzz 7f2fa91363 i2snark: Save all magnet link trackers in torrent file
part 2/3

- fix NPE in part 1
- store all in torrent file when saved
2026-08-28 15:11:38 -04:00
zzz b9b9ea86e4 javadoc fix 2026-08-28 13:24:17 -04:00
zzz 89d24b80b0 i2snark: Use all trackers in magnet links, not just the first
part 1/2

- Pass MagnetURI directly to addMagnet()
- Store all trackers in Snark and TrackerClient
- save all trackers in per-torrent config file
2026-08-28 13:23:42 -04:00
zzz 563d0a7244 i2snark: Add length from xl param to magnet name if available 2026-08-28 09:11:31 -04:00
zzz 97c435565c i2snark: Refactor Message.sendMessage() to use a switch
for efficiency and sanity.
Add support for BEP 52 messages.
2026-08-28 07:43:17 -04:00
zzz e40b54f844 i2snark: v2 WIP part 7
- consolidate length rectification code
- fix rectification for file length > 2 GB
- make InputStream method public again, with the requirement
  to call rectify() first for files
- clarify plen param requirement for files vs. pieces
- add plen param for byte[] method
- add debug output for empty hashes
2026-08-27 17:24:55 -04:00
zzz 73cc98d28b i2psnark: Compress KRPC DG1 messages 2026-08-26 08:21:00 -04:00
zzz 6efe2dc715 i2psnark: Compress UDP connect requests 2026-08-26 07:59:51 -04:00
zzz 529ea7ac43 i2psnark: Close all RAFs after creating or checking files
to avoid possible stale fds after errors,
ro vs rw issues after rechecks, running out of fds,
and other corner cases
2026-08-25 09:30:45 -04:00
zzz fda1ced99c i2psnark: Remove ancient/disabled single-torrent and CLI code
from the original snark, unused for 20 years.
CoordinatorSet and acceptor are now always non-null.
Cleanup in prep for hybrid support (WIP)
2026-08-24 11:10:54 -04:00
zzz d0fae9f895 i2psnark: Only call retransmitRequests() for non-fast peers 2026-08-24 08:25:02 -04:00
zzz a60f10ba3b i2psnark: Reduce log level for common error serving file resources 2026-08-23 11:21:36 -04:00
zzz 5311271498 i2snark: v2 WIP cleanup
a v2 infohash is a Hash not a MerkleHash
2026-08-23 11:15:14 -04:00
zzz a258c86b06 i2snark: v2 WIP part 6 2026-08-23 11:12:24 -04:00
zzz 029d2df70e i2snark: limit log in one more spot 2026-08-23 11:09:12 -04:00
zzz 517e660389 i2psnark: Add support for magnet xl param 2026-08-22 10:31:53 -04:00
zzz 697bb94f8f i2psnark: Smooth out request throttling
The request throttler had several problems:

- Throttling was very laggy, but when it reacted it throttled too quickly.
- PartialPieces got returned back to PeerCoordinator,
  and then back to PeerState, every few seconds, rather
  than continuing steady-state in PeerState
- Holding the PartialPiece in the PeerCoordinator for
  several seconds while staying interested is poor and risks snubbing
- Max request queue size was reduced far too quickly,
  doing so exponentially when the reduction occurred linearly
- shouldRequest() called the request limiter second in the conditional,
  so the estimator was not decayed properly when over down bw limit
- shouldRequest() used overDownBandwidthLimit() rather than _down.offer(),
  ensuring a very slow and laggy feedback loop.
- Requests were added too quickly on unthrottle

Fix these by:

- Fixing and slowing max request queue size reduction to simulate
  an exponential reduction over time when throttled
- Fixing shouldRequest() to always call offer() for both limiters
- Slow addition of requests after unthrottle to simulate
  a linear increase over time

Log tweaks also

The request queue now mostly maintains a steady size,
and properly meters the requests.
The PartialPiece returns to the PeerCoordinator much less often,
and comes back to PeerState much quicker if it does.

Further tuning TODO
2026-08-22 10:22:50 -04:00
zzz 171838070a i2psnark: Improve handling of chunks received out-of-order
- For fast peers:
  Do not rerequest, peer is expected to meet its BEP 6 obligation,
  and rerequesting needlessly inflates the request bandwidth estimate
- Drop dup requests for pieces peers already have
- Remove old comment about future enhancements we already did
- Fix repeated PartialPiece log about hole filled in
- Log tweaks

Should improve d/l from qbittorrent that aggressively reorders
2026-08-21 11:30:42 -04:00
zzz cc63ee6843 i2psnark: Improve BitField.toString() for logging 2026-08-20 11:29:20 -04:00
zzz 101a9e54e4 i2psnark: Enum for metainfo types + cleanups (v2 WIP part 5)
- FileTree remove unused param
- PieceLayers remove unused method
2026-08-20 09:38:22 -04:00
zzz 2b002e2b7a i2psnark: Don't load whole pieces in memory when creating/rechecking torrents
for large piece sizes, use a buffer instead,
in two spots: creating and rechecking.
Pass the hash instead of the piece to MetaInfo.checkPiece()
Remove now-unused methods.
2026-08-19 12:06:22 -04:00
zzz 7751367b85 i2psnark: Fail in BDecoder on dup dictionary entry 2026-08-18 17:40:33 -04:00