* i2psnark:
- Fix end-game deadlock - Fix last-modified check for multifile torrents, causing apparent loss of data after abnormal exit - UI Tweaks
This commit is contained in:
@ -566,12 +566,13 @@ public class PeerCoordinator implements PeerListener
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Piece piece = null;
|
||||||
|
List<Piece> requested = new ArrayList();
|
||||||
|
int wantedSize = END_GAME_THRESHOLD + 1;
|
||||||
synchronized(wantedPieces)
|
synchronized(wantedPieces)
|
||||||
{
|
{
|
||||||
Piece piece = null;
|
|
||||||
if (record)
|
if (record)
|
||||||
Collections.sort(wantedPieces); // Sort in order of rarest first.
|
Collections.sort(wantedPieces); // Sort in order of rarest first.
|
||||||
List<Piece> requested = new ArrayList();
|
|
||||||
Iterator<Piece> it = wantedPieces.iterator();
|
Iterator<Piece> it = wantedPieces.iterator();
|
||||||
while (piece == null && it.hasNext())
|
while (piece == null && it.hasNext())
|
||||||
{
|
{
|
||||||
@ -588,13 +589,18 @@ public class PeerCoordinator implements PeerListener
|
|||||||
requested.add(p);
|
requested.add(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (piece == null)
|
||||||
|
wantedSize = wantedPieces.size();
|
||||||
|
} // synch
|
||||||
|
|
||||||
|
// Don't sync the following, deadlock from calling each Peer's isRequesting()
|
||||||
|
|
||||||
//Only request a piece we've requested before if there's no other choice.
|
//Only request a piece we've requested before if there's no other choice.
|
||||||
if (piece == null) {
|
if (piece == null) {
|
||||||
// AND if there are almost no wanted pieces left (real end game).
|
// AND if there are almost no wanted pieces left (real end game).
|
||||||
// If we do end game all the time, we generate lots of extra traffic
|
// If we do end game all the time, we generate lots of extra traffic
|
||||||
// when the seeder is super-slow and all the peers are "caught up"
|
// when the seeder is super-slow and all the peers are "caught up"
|
||||||
if (wantedPieces.size() > END_GAME_THRESHOLD)
|
if (wantedSize > END_GAME_THRESHOLD)
|
||||||
return -1; // nothing to request and not in end game
|
return -1; // nothing to request and not in end game
|
||||||
// let's not all get on the same piece
|
// let's not all get on the same piece
|
||||||
// Even better would be to sort by number of requests
|
// Even better would be to sort by number of requests
|
||||||
@ -608,6 +614,7 @@ public class PeerCoordinator implements PeerListener
|
|||||||
// limit number of parallel requests
|
// limit number of parallel requests
|
||||||
int requestedCount = 0;
|
int requestedCount = 0;
|
||||||
for (Peer pr : peers) {
|
for (Peer pr : peers) {
|
||||||
|
// deadlock if synced on wantedPieces
|
||||||
if (pr.isRequesting(p.getId())) {
|
if (pr.isRequesting(p.getId())) {
|
||||||
if (pr.equals(peer)) {
|
if (pr.equals(peer)) {
|
||||||
// don't give it to him again
|
// don't give it to him again
|
||||||
@ -645,7 +652,6 @@ public class PeerCoordinator implements PeerListener
|
|||||||
}
|
}
|
||||||
return piece.getId();
|
return piece.getId();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps file priorities to piece priorities.
|
* Maps file priorities to piece priorities.
|
||||||
|
@ -514,7 +514,7 @@ public class Storage
|
|||||||
RAFfile[i] = f;
|
RAFfile[i] = f;
|
||||||
total += lengths[i];
|
total += lengths[i];
|
||||||
if (useSavedBitField) {
|
if (useSavedBitField) {
|
||||||
long lm = base.lastModified();
|
long lm = f.lastModified();
|
||||||
if (lm <= 0 || lm > savedTime)
|
if (lm <= 0 || lm > savedTime)
|
||||||
useSavedBitField = false;
|
useSavedBitField = false;
|
||||||
}
|
}
|
||||||
|
@ -289,18 +289,21 @@ public class I2PSnarkServlet extends Default {
|
|||||||
out.write("<img border=\"0\" src=\"" + _imgPath + "eta.png\" alt=\"\" title=\"");
|
out.write("<img border=\"0\" src=\"" + _imgPath + "eta.png\" alt=\"\" title=\"");
|
||||||
out.write(_("Estimated time remaining"));
|
out.write(_("Estimated time remaining"));
|
||||||
out.write("\">");
|
out.write("\">");
|
||||||
|
// Translators: Please keep short or translate as " "
|
||||||
out.write(_("ETA"));
|
out.write(_("ETA"));
|
||||||
}
|
}
|
||||||
out.write("</th>\n<th align=\"right\">");
|
out.write("</th>\n<th align=\"right\">");
|
||||||
out.write("<img border=\"0\" src=\"" + _imgPath + "head_rx.png\" alt=\"\" title=\"");
|
out.write("<img border=\"0\" src=\"" + _imgPath + "head_rx.png\" alt=\"\" title=\"");
|
||||||
out.write(_("Downloaded"));
|
out.write(_("Downloaded"));
|
||||||
out.write("\">");
|
out.write("\">");
|
||||||
|
// Translators: Please keep short or translate as " "
|
||||||
out.write(_("RX"));
|
out.write(_("RX"));
|
||||||
out.write("</th>\n<th align=\"right\">");
|
out.write("</th>\n<th align=\"right\">");
|
||||||
if (_manager.util().connected() && !snarks.isEmpty()) {
|
if (_manager.util().connected() && !snarks.isEmpty()) {
|
||||||
out.write("<img border=\"0\" src=\"" + _imgPath + "head_tx.png\" alt=\"\" title=\"");
|
out.write("<img border=\"0\" src=\"" + _imgPath + "head_tx.png\" alt=\"\" title=\"");
|
||||||
out.write(_("Uploaded"));
|
out.write(_("Uploaded"));
|
||||||
out.write("\">");
|
out.write("\">");
|
||||||
|
// Translators: Please keep short or translate as " "
|
||||||
out.write(_("TX"));
|
out.write(_("TX"));
|
||||||
}
|
}
|
||||||
out.write("</th>\n<th align=\"right\">");
|
out.write("</th>\n<th align=\"right\">");
|
||||||
@ -310,6 +313,7 @@ public class I2PSnarkServlet extends Default {
|
|||||||
out.write("\" alt=\"");
|
out.write("\" alt=\"");
|
||||||
out.write(_("RX"));
|
out.write(_("RX"));
|
||||||
out.write(" \">");
|
out.write(" \">");
|
||||||
|
// Translators: Please keep short or translate as " "
|
||||||
out.write(_("Rate"));
|
out.write(_("Rate"));
|
||||||
}
|
}
|
||||||
out.write("</th>\n<th align=\"right\">");
|
out.write("</th>\n<th align=\"right\">");
|
||||||
@ -1007,39 +1011,39 @@ public class I2PSnarkServlet extends Default {
|
|||||||
out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">");
|
out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">");
|
||||||
if (remaining > 0) {
|
if (remaining > 0) {
|
||||||
if (peer.isInteresting() && !peer.isChoked()) {
|
if (peer.isInteresting() && !peer.isChoked()) {
|
||||||
out.write("<font color=#00ff00>");
|
out.write("<span class=\"unchoked\">");
|
||||||
out.write(formatSize(peer.getDownloadRate()) + "ps</font>");
|
out.write(formatSize(peer.getDownloadRate()) + "ps</span>");
|
||||||
} else {
|
} else {
|
||||||
out.write("<font color=#ff0000><a title=\"");
|
out.write("<span class=\"choked\"><a title=\"");
|
||||||
if (!peer.isInteresting())
|
if (!peer.isInteresting())
|
||||||
out.write(_("Uninteresting (The peer has no pieces we need)"));
|
out.write(_("Uninteresting (The peer has no pieces we need)"));
|
||||||
else
|
else
|
||||||
out.write(_("Choked (The peer is not allowing us to request pieces)"));
|
out.write(_("Choked (The peer is not allowing us to request pieces)"));
|
||||||
out.write("\">");
|
out.write("\">");
|
||||||
out.write(formatSize(peer.getDownloadRate()) + "ps</a></font>");
|
out.write(formatSize(peer.getDownloadRate()) + "ps</a></span>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.write("</td>\n\t");
|
out.write("</td>\n\t");
|
||||||
out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">");
|
out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">");
|
||||||
if (pct != 100.0) {
|
if (pct != 100.0) {
|
||||||
if (peer.isInterested() && !peer.isChoking()) {
|
if (peer.isInterested() && !peer.isChoking()) {
|
||||||
out.write("<font color=#00ff00>");
|
out.write("<span class=\"unchoked\">");
|
||||||
out.write(formatSize(peer.getUploadRate()) + "ps</font>");
|
out.write(formatSize(peer.getUploadRate()) + "ps</span>");
|
||||||
} else {
|
} else {
|
||||||
out.write("<font color=#ff0000><a title=\"");
|
out.write("<span class=\"choked\"><a title=\"");
|
||||||
if (!peer.isInterested())
|
if (!peer.isInterested())
|
||||||
out.write(_("Uninterested (We have no pieces the peer needs)"));
|
out.write(_("Uninterested (We have no pieces the peer needs)"));
|
||||||
else
|
else
|
||||||
out.write(_("Choking (We are not allowing the peer to request pieces)"));
|
out.write(_("Choking (We are not allowing the peer to request pieces)"));
|
||||||
out.write("\">");
|
out.write("\">");
|
||||||
out.write(formatSize(peer.getUploadRate()) + "ps</a></font>");
|
out.write(formatSize(peer.getUploadRate()) + "ps</a></span>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.write("</td>\n\t");
|
out.write("</td>\n\t");
|
||||||
out.write("<td class=\"snarkTorrentStatus " + rowClass + "\">");
|
out.write("<td class=\"snarkTorrentStatus " + rowClass + "\">");
|
||||||
out.write("</td></tr>\n\t");
|
out.write("</td></tr>\n\t");
|
||||||
if (showDebug)
|
if (showDebug)
|
||||||
out.write("<tr><td></td><td colspan=\"10\" align=\"right\" class=\"" + rowClass + "\">" + peer.getSocket() + "</td></tr>");
|
out.write("<tr class=\"" + rowClass + "\"><td></td><td colspan=\"10\" align=\"right\" class=\"" + rowClass + "\">" + peer.getSocket() + "</td></tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,16 +277,20 @@ msgid "Downloaded"
|
|||||||
msgstr "heruntergeladen"
|
msgstr "heruntergeladen"
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:295
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:295
|
||||||
|
# NOTE: purposely left blank to leave more room in the table header
|
||||||
|
#msgstr "heruntergeladen"
|
||||||
msgid "RX"
|
msgid "RX"
|
||||||
msgstr "heruntergeladen"
|
msgstr " "
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:298
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:298
|
||||||
msgid "Uploaded"
|
msgid "Uploaded"
|
||||||
msgstr "hochgeladen"
|
msgstr "hochgeladen"
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:300
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:300
|
||||||
|
# NOTE: purposely left blank to leave more room in the table header
|
||||||
|
#msgstr "hochgeladen"
|
||||||
msgid "TX"
|
msgid "TX"
|
||||||
msgstr "hochgeladen"
|
msgstr " "
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:303
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:303
|
||||||
msgid "Down Rate"
|
msgid "Down Rate"
|
||||||
@ -294,8 +298,10 @@ msgstr "eingehend"
|
|||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:305
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:305
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:310
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:310
|
||||||
|
# NOTE: purposely left blank to leave more room in the table header
|
||||||
|
#msgstr "Übertragung"
|
||||||
msgid "Rate"
|
msgid "Rate"
|
||||||
msgstr "Übertragung"
|
msgstr " "
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:308
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:308
|
||||||
msgid "Up Rate"
|
msgid "Up Rate"
|
||||||
|
@ -269,8 +269,10 @@ msgstr "tiempo restante de descarga"
|
|||||||
|
|
||||||
#. space here would look better but nbsp is too big and thinsp breaks
|
#. space here would look better but nbsp is too big and thinsp breaks
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:290
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:290
|
||||||
|
# NOTE: purposely left blank to leave more room in the table header
|
||||||
|
#msgstr "Completado en"
|
||||||
msgid "ETA"
|
msgid "ETA"
|
||||||
msgstr "Completado en"
|
msgstr " "
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:293
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:293
|
||||||
msgid "Downloaded"
|
msgid "Downloaded"
|
||||||
@ -294,8 +296,10 @@ msgstr "Tasa de descarga"
|
|||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:305
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:305
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:310
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:310
|
||||||
|
# NOTE: purposely left blank to leave more room in the table header
|
||||||
|
#msgstr "Tasa de transferencia"
|
||||||
msgid "Rate"
|
msgid "Rate"
|
||||||
msgstr "Tasa de transferencia"
|
msgstr " "
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:308
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:308
|
||||||
msgid "Up Rate"
|
msgid "Up Rate"
|
||||||
|
@ -268,8 +268,10 @@ msgid "Estimated Download Time"
|
|||||||
msgstr "Temps estimé de téléchargement"
|
msgstr "Temps estimé de téléchargement"
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:278
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:278
|
||||||
|
# NOTE: purposely left blank to leave more room in the table header
|
||||||
|
#msgstr "Temps restant"
|
||||||
msgid "ETA"
|
msgid "ETA"
|
||||||
msgstr "Temps restant"
|
msgstr " "
|
||||||
|
|
||||||
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:281
|
#: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:281
|
||||||
msgid "Downloaded"
|
msgid "Downloaded"
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2010-12-12 zzz
|
||||||
|
* i2psnark:
|
||||||
|
- Fix end-game deadlock
|
||||||
|
- Fix last-modified check for multifile torrents, causing
|
||||||
|
apparent loss of data after abnormal exit
|
||||||
|
- Tweaks
|
||||||
|
|
||||||
2010-12-11 zzz
|
2010-12-11 zzz
|
||||||
* Build: Fix 'ant distclean poupdate' again
|
* Build: Fix 'ant distclean poupdate' again
|
||||||
* I2CP: Change a log error to a warning (ticket #353)
|
* I2CP: Change a log error to a warning (ticket #353)
|
||||||
|
@ -361,6 +361,14 @@ td:first-child {
|
|||||||
color: #dd7 !important;
|
color: #dd7 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.choked {
|
||||||
|
color: #f00000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unchoked {
|
||||||
|
color: #00f000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.thumb {
|
.thumb {
|
||||||
max-height: 64px;
|
max-height: 64px;
|
||||||
max-width: 96px;
|
max-width: 96px;
|
||||||
|
@ -365,6 +365,14 @@ td:first-child {
|
|||||||
color: #505 !important;
|
color: #505 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.choked {
|
||||||
|
color: #a00000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unchoked {
|
||||||
|
color: #008000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.thumb {
|
.thumb {
|
||||||
max-height: 64px;
|
max-height: 64px;
|
||||||
max-width: 96px;
|
max-width: 96px;
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 36;
|
public final static long BUILD = 37;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "-rc";
|
public final static String EXTRA = "-rc";
|
||||||
|
Reference in New Issue
Block a user