Changeset bdfca07


Ignore:
Timestamp:
Mar 24, 2012 12:58:13 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ed134249
Parents:
008c79e
Message:
  • Fix dup torrent msg with magnets (tickets #433 and #504)
  • Fix state when storage dies during transition out of magnet mode
  • Fix NPE in magnet mode
  • Error logging improvements
  • Support add-torrent with infohash alone
  • CSS tweaks
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/Snark.java

    r008c79e rbdfca07  
    10321032    if (t != null)
    10331033        s += ": " + t;
     1034    if (completeListener != null)
     1035        completeListener.fatal(this, s);
    10341036    throw new RuntimeException(s, t);
    10351037  }
     
    10591061   */
    10601062  public void gotMetaInfo(PeerCoordinator coordinator, MetaInfo metainfo) {
    1061       meta = metainfo;
    10621063      try {
    1063           storage = new Storage(_util, meta, this);
     1064          // The following two may throw IOE...
     1065          storage = new Storage(_util, metainfo, this);
    10641066          storage.check(rootDataDir);
     1067          // ... so don't set meta until here
     1068          meta = metainfo;
    10651069          if (completeListener != null) {
    10661070              String newName = completeListener.gotMetaInfo(this);
     
    11701174    public String gotMetaInfo(Snark snark);
    11711175
     1176    /**
     1177     * @since 0.9
     1178     */
     1179    public void fatal(Snark snark, String error);
     1180
    11721181    // not really listeners but the easiest way to get back to an optional SnarkManager
    11731182    public long getSavedTorrentTime(Snark snark);
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    r008c79e rbdfca07  
    12811281            }
    12821282            saveTorrentStatus(meta, storage.getBitField(), null); // no file priorities
    1283             String name = (new File(getDataDir(), storage.getBaseName() + ".torrent")).getAbsolutePath();
     1283            // temp for addMessage() in case canonical throws
     1284            String name = storage.getBaseName();
    12841285            try {
     1286                // _snarks must use canonical
     1287                name = (new File(getDataDir(), storage.getBaseName() + ".torrent")).getCanonicalPath();
    12851288                // put the announce URL in the file
    12861289                String announce = snark.getTrackerURL();
     
    13061309    }
    13071310
     1311    /**
     1312     * A Snark.CompleteListener method.
     1313     * @since 0.9
     1314     */
     1315    public void fatal(Snark snark, String error) {
     1316        addMessage(_("Error on torrent {0}", snark.getName()) + ": " + error);
     1317    }
     1318   
    13081319    // End Snark.CompleteListeners
    13091320
  • apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java

    r008c79e rbdfca07  
    349349
    350350            // Get peers from PEX
    351             if (left > 0 && coordinator.needPeers() && (!meta.isPrivate()) && !stop) {
     351            if (left > 0 && coordinator.needPeers() && (meta == null || !meta.isPrivate()) && !stop) {
    352352                Set<PeerID> pids = coordinator.getPEXPeers();
    353353                if (!pids.isEmpty()) {
     
    371371            // Get peers from DHT
    372372            // FIXME this needs to be in its own thread
    373             if (_util.getDHT() != null && (!meta.isPrivate()) && !stop) {
     373            if (_util.getDHT() != null && (meta == null || !meta.isPrivate()) && !stop) {
    374374                int numwant;
    375375                if (left == 0 || event.equals(STOPPED_EVENT) || !coordinator.needPeers())
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r008c79e rbdfca07  
    545545                } else if (newURL.startsWith(MAGNET) || newURL.startsWith(MAGGOT)) {
    546546                    addMagnet(newURL);
     547                } else if (newURL.length() == 40 && newURL.replaceAll("[a-fA-F0-9]", "").length() == 0) {
     548                    addMagnet(MAGNET_FULL + newURL);
    547549                } else {
    548550                    _manager.addMessage(_("Invalid URL: Must start with \"http://\", \"{0}\", or \"{1}\"", MAGNET, MAGGOT));
     
    13171319        out.write(":<td><input type=\"text\" name=\"newURL\" size=\"85\" value=\"" + newURL + "\"");
    13181320        out.write(" title=\"");
    1319         out.write(_("Enter the torrent file download URL (I2P only), magnet link, or maggot link"));
     1321        out.write(_("Enter the torrent file download URL (I2P only), magnet link, maggot link, or info hash"));
    13201322        out.write("\"> \n");
    13211323        // not supporting from file at the moment, since the file name passed isn't always absolute (so it may not resolve)
     
    15101512        out.write(_("Up bandwidth limit"));
    15111513        out.write(": <td><input type=\"text\" name=\"upBW\" class=\"r\" value=\""
    1512                   + _manager.util().getMaxUpBW() + "\" size=\"3\" maxlength=\"3\" > KBps <i>(");
     1514                  + _manager.util().getMaxUpBW() + "\" size=\"3\" maxlength=\"3\" > KBps <i>");
    15131515        out.write(_("Half available bandwidth recommended."));
    1514         out.write(" <a href=\"/config.jsp\" target=\"blank\">");
     1516        out.write("<br><a href=\"/config.jsp\" target=\"blank\">");
    15151517        out.write(_("View or change router bandwidth"));
    1516         out.write("</a>)</i><br>\n" +
     1518        out.write("</a></i><br>\n" +
    15171519       
    15181520                  "<tr><td>");
  • history.txt

    r008c79e rbdfca07  
     12012-03-24 zzz
     2  * GarlicConfig: Remove more unused methods
     3  * i2psnark:
     4    - Fix dup torrent msg with magnets (tickets #433 and #504)
     5    - Fix state when storage dies during transition out of magnet mode
     6    - Fix NPE in magnet mode
     7    - Error logging improvements
     8    - Support add-torrent with infohash alone
     9    - CSS tweaks
     10
    1112012-03-22 zzz
    212  * Home page: CSS tweaks
  • installer/resources/themes/snark/ubergine/snark.css

    r008c79e rbdfca07  
    9494     overflow: auto;
    9595     color: #26f;
    96      max-height: 76px;
     96     max-height: 82px;
    9797     min-height: 45px;
    9898     width: auto;
  • installer/resources/themes/snark/vanilla/snark.css

    r008c79e rbdfca07  
    9393     overflow: auto;
    9494     color: #26f;
    95      max-height: 76px;
     95     max-height: 82px;
    9696     min-height: 45px;
    9797     width: auto;
  • router/java/src/net/i2p/router/RouterVersion.java

    r008c79e rbdfca07  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 20;
     21    public final static long BUILD = 21;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.