Changeset 3ef89f4


Ignore:
Timestamp:
Nov 22, 2014 5:19:40 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
04cd1ce
Parents:
2a681608
Message:

SAM: Fix v3 bug accepting incoming connections
It was starting both the v3 and v1 acceptors.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/sam/java/src/net/i2p/sam/SAMStreamSession.java

    r2a681608 r3ef89f4  
    8383     *
    8484     * @param dest Base64-encoded destination and private keys (same format as PrivateKeyFile)
    85      * @param dir Session direction ("RECEIVE", "CREATE" or "BOTH")
     85     * @param dir Session direction ("RECEIVE", "CREATE" or "BOTH") or "__v3__" if extended by SAMv3StreamSession
    8686     * @param props Properties to setup the I2P session
    8787     * @param recv Object that will receive incoming data
     
    9999     *
    100100     * @param destStream Input stream containing the destination and private keys (same format as PrivateKeyFile)
    101      * @param dir Session direction ("RECEIVE", "CREATE" or "BOTH")
     101     * @param dir Session direction ("RECEIVE", "CREATE" or "BOTH") or "__v3__" if extended by SAMv3StreamSession
    102102     * @param props Properties to setup the I2P session
    103103     * @param recv Object that will receive incoming data
     
    112112
    113113        boolean canReceive;
     114        boolean startAcceptor;
    114115        if (dir.equals("BOTH")) {
    115116            canCreate = true;
    116117            canReceive = true;
     118            startAcceptor = true;
     119        } else if (dir.equals("__v3__")) {
     120            // we are super to SAMv3StreamSession, don't start thread, he handles it
     121            canCreate = true;
     122            canReceive = true;
     123            startAcceptor = false;
    117124        } else if (dir.equals("CREATE")) {
    118125            canCreate = true;
    119126            canReceive = false;
     127            startAcceptor = false;
    120128        } else if (dir.equals("RECEIVE")) {
    121129            canCreate = false;
    122130            canReceive = true;
     131            startAcceptor = true;
    123132        } else {
    124133            _log.error("BUG! Wrong direction passed to SAMStreamSession: "
     
    163172       
    164173
    165         if (canReceive) {
     174        if (startAcceptor) {
    166175            server = new SAMStreamSessionServer();
    167176            Thread t = new I2PAppThread(server, "SAMStreamSessionServer");
  • apps/sam/java/src/net/i2p/sam/SAMv3StreamSession.java

    r2a681608 r3ef89f4  
    6262                        throws IOException, DataFormatException, SAMException
    6363            {
    64                 super(getDB().get(login).getDest(), "BOTH",
     64                super(getDB().get(login).getDest(), "__v3__",
    6565                      getDB().get(login).getProps(),
    6666                      getDB().get(login).getHandler());
  • history.txt

    r2a681608 r3ef89f4  
    22 * PeerSelector: If non-DSA, don't use incompatible peers
    33   for exploratory tunnels or closest-hop in client tunnels
     4 * SAM: Fix v3 bug accepting incoming connections
    45
    562014-11-17 zzz
  • router/java/src/net/i2p/router/RouterVersion.java

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