Changeset 2014533 for apps


Ignore:
Timestamp:
Jun 9, 2018 1:42:12 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3f92d92
Parents:
7b379162
Message:

i2psnark: Fix torrent ignoring priority settings when autostart is enabled (ticket #2229)

Location:
apps/i2psnark/java/src/org/klomp/snark
Files:
4 edited

Legend:

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

    r7b379162 r2014533  
    301301  /**
    302302   * multitorrent
     303   *
     304   * Will not start itself. Caller must call startTorrent() if desired.
     305   *
    303306   * @throws RuntimeException via fatal()
    304307   */
     
    306309        StorageListener slistener, CoordinatorListener clistener,
    307310        CompleteListener complistener, PeerCoordinatorSet peerCoordinatorSet,
    308         ConnectionAcceptor connectionAcceptor, boolean start, String rootDir)
     311        ConnectionAcceptor connectionAcceptor, String rootDir)
    309312  {
    310313      this(util, torrent, ip, user_port, slistener, clistener, complistener,
    311            peerCoordinatorSet, connectionAcceptor, start, rootDir, null);
     314           peerCoordinatorSet, connectionAcceptor, rootDir, null);
    312315  }
    313316
    314317  /**
    315318   * multitorrent
     319   *
     320   * Will not start itself. Caller must call startTorrent() if desired.
    316321   *
    317322   * @param baseFile if null, use rootDir/torrentName; if non-null, use it instead
     
    322327        StorageListener slistener, CoordinatorListener clistener,
    323328        CompleteListener complistener, PeerCoordinatorSet peerCoordinatorSet,
    324         ConnectionAcceptor connectionAcceptor, boolean start, String rootDir, File baseFile)
     329        ConnectionAcceptor connectionAcceptor, String rootDir, File baseFile)
    325330  {
    326331    if (slistener == null)
     
    483488    if (completeListener != null)
    484489        _comments = completeListener.getSavedComments(this);
    485 
    486     if (start)
    487         startTorrent();
    488490  }
    489491
    490492  /**
    491493   *  multitorrent, magnet
     494   *
     495   *  Will not start itself. Caller must call startTorrent() if desired.
    492496   *
    493497   *  @param torrent a fake name for now (not a file name)
     
    499503  public Snark(I2PSnarkUtil util, String torrent, byte[] ih, String trackerURL,
    500504        CompleteListener complistener, PeerCoordinatorSet peerCoordinatorSet,
    501         ConnectionAcceptor connectionAcceptor, boolean start, String rootDir)
     505        ConnectionAcceptor connectionAcceptor, String rootDir)
    502506  {
    503507    completeListener = complistener;
     
    517521    // meta remains null
    518522    // storage remains null
    519 
    520     if (start)
    521         startTorrent();
    522523  }
    523524
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    r7b379162 r2014533  
    15561556                    torrent = new Snark(_util, filename, null, -1, null, null, this,
    15571557                                        _peerCoordinatorSet, _connectionAcceptor,
    1558                                         shouldAutoStart(), dataDir.getPath(), baseFile);
     1558                                        dataDir.getPath(), baseFile);
    15591559                    loadSavedFilePriorities(torrent);
    15601560                    synchronized (_snarks) {
    15611561                        _snarks.put(filename, torrent);
    15621562                    }
     1563                    if (shouldAutoStart())
     1564                        torrent.startTorrent();
    15631565                } catch (IOException ioe) {
    15641566                    // close before rename/delete for windows
     
    16611663        Snark torrent = new Snark(_util, name, ih, trackerURL, listener,
    16621664                                  _peerCoordinatorSet, _connectionAcceptor,
    1663                                   false, dirPath);
     1665                                  dirPath);
    16641666
    16651667        synchronized (_snarks) {
  • apps/i2psnark/java/src/org/klomp/snark/web/FetchAndAdd.java

    r7b379162 r2014533  
    7373        // magnet constructor
    7474        super(mgr.util(), "Torrent download",
    75               null, null, null, null, null, false, null);
     75              null, null, null, null, null, null);
    7676        _ctx = ctx;
    7777        _log = ctx.logManager().getLog(FetchAndAdd.class);
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r7b379162 r2014533  
    39153915            }
    39163916        }
    3917          snark.updatePiecePriorities();
     3917        snark.updatePiecePriorities();
    39183918        _manager.saveTorrentStatus(snark);
    39193919    }
Note: See TracChangeset for help on using the changeset viewer.