zzz e7774feb12 i2psnark: Remove outstanding requests from pieces when connection is replaced
Hopefully fixes rare case where torrents get stuck.
Tested that it doesn't break anything, but was never able to reproduce the issue.

As reported in torrent at http://tracker2.postman.i2p/index.php?view=TorrentDetail&id=85798
Fix adapted and greatly simplified from source code included in that torrent.
Apparently from old trac ticket #691.
Credit: smtorrents

Also:
- Fix place where removePeerFromPieces() was being called twice,
  once directly and once from disconnect(true).
- Fix javadoc for Peer.disconnect()
- Fix log typo
- Add comments

Description from OP of that torrent:

This update now finally fixes the decades old ticket number 691 which prevents torrents to complete from time to time. The bug manifests itself by keeping a couple of outstanding pieces (> 8, so we never get into the endgame) that are marked as requested from a peerID, with a corresponding peer that has long gone. Those pieces are never requested from any other peer. There are consequently more peerIDs than peers connected.

The only place in code, where peers and peer IDs are mixed up, is a reconnect logic that tries to reuse an existing connection while keeping outstanding requests from the old connection, when the other end tries to reconnect.

Keeping old requests is faulty by itself because someone reconnecting to us will definitely have dropped our previous requests, so we must do the same. The fix now always drops previous connections along with all outstanding requests.
2025-04-20 12:06:28 -04:00
2025-03-30 07:11:55 -04:00
2025-03-29 11:41:42 -04:00
2022-07-17 01:45:55 -07:00
2024-01-28 12:09:10 +00:00
2024-01-28 12:09:10 +00:00
2025-04-16 06:26:24 -04:00
2016-09-10 16:26:29 +00:00
2018-12-11 11:22:43 +00:00
2024-02-19 15:26:13 -05:00
2024-01-28 12:09:10 +00:00
2024-01-28 12:09:10 +00:00
2024-01-28 12:09:10 +00:00
2024-01-28 12:09:10 +00:00
2025-04-16 06:26:24 -04:00
2025-03-04 10:20:56 -05:00
2025-03-04 10:20:56 -05:00
2021-11-24 10:33:30 -05:00

I2P

This is the source code for the reference Java implementation of I2P.

Latest release: https://geti2p.net/download

Installing

See INSTALL.txt or https://geti2p.net/download for installation instructions.

Documentation

https://geti2p.net/how

FAQ: https://geti2p.net/faq

API: http://docs.i2p-projekt.de/javadoc/ or run 'ant javadoc' then start at build/javadoc/index.html

How to contribute / Hack on I2P

Please check out HACKING.md and other documents in the docs directory.

Building packages from source

To get development branch from source control: https://geti2p.net/newdevelopers

Prerequisites

  • Java SDK (preferably Oracle or OpenJDK) 8 or higher
    • Non-linux operating systems and JVMs: See https://trac.i2p2.de/wiki/java
    • Certain subsystems for embedded (core, router, mstreaming, streaming, i2ptunnel) require only Java 6
  • Apache Ant 1.9.8 or higher
  • The xgettext, msgfmt, and msgmerge tools installed from the GNU gettext package http://www.gnu.org/software/gettext/
  • Build environment must use a UTF-8 locale.

Ant build process

On x86 systems do:

ant pkg

On non-x86, use one of the following instead:

ant installer-linux
ant installer-freebsd
ant installer-osx

Run 'ant' with no arguments to see other build options.

Gradle build process

Full builds of installers or updates are not yet possible, but the code can be compiled with:

./gradlew assemble

This will download dependencies over the clearnet by default, including Gradle itself. To download through a SOCKS proxy (e.g. Tor), add the following lines to your ~/.gradle/gradle.properties:

systemProp.socksProxyHost=localhost
systemProp.socksProxyPort=9150

Development builds

Automatic CI builds are available at the continuous integration page.

Docker

For more information how to run I2P in Docker, see Docker.md

Contact info

Need help? See the IRC channel #i2p on irc.freenode.net

Bug reports: https://i2pgit.org/i2p-hackers/i2p.i2p/-/issues http://git.idk.i2p/i2p-hackers/i2p.i2p/-/issues

Contact information, security issues, press inquiries: https://geti2p.net/en/contact

Twitter: @i2p, @geti2p

Licenses

See LICENSE.txt

Description
The I2P anonymous network, Java Implementation
Readme 502 MiB
Languages
Java 86.9%
CSS 4.8%
HTML 4%
Shell 1.1%
JavaScript 1.1%
Other 1.9%