Changeset 485acd6c


Ignore:
Timestamp:
Apr 2, 2015 8:52:40 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2f5f91a
Parents:
9dc2ae0
Message:

Remove all the startRunning() calls in constructors,
which duplicated the new ones in I2PTunnel, causing all sorts of trouble.
May still need more locking. TBD.

Location:
apps/i2ptunnel/java/src/net/i2p/i2ptunnel
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java

    r9dc2ae0 r485acd6c  
    3333
    3434    /**
     35     * As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     36     * or open the local socket. You MUST call startRunning() for that.
     37     *
    3538     * @param destinations peers we target, comma- or space-separated. Since 0.9.9, each dest may be appended with :port
    3639     * @throws IllegalArgumentException if the I2PTunnel does not contain
     
    6467
    6568        setName(getLocalPort() + " -> " + destinations);
    66 
    67         startRunning();
    68 
    6969        notifyEvent("openClientResult", "ok");
    7070    }
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java

    r9dc2ae0 r485acd6c  
    399399                log.log("Error opening key file " + ioe);
    400400            _log.error("Error opening key file", ioe);
    401             throw new IllegalArgumentException("Error opening key file " + ioe);
     401            throw new IllegalArgumentException("Error opening key file", ioe);
    402402        } finally {
    403403            if (fis != null)
     
    501501       
    502502    private void startup() {
     503        if (_log.shouldLog(Log.DEBUG))
     504            _log.debug("startup " + _clientId, new Exception("I did it"));
    503505        // prevent JVM exit when running outside the router
    504506        boolean isDaemon = getTunnel().getContext().isRouterContext();
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java

    r9dc2ae0 r485acd6c  
    7878   
    7979    /**
     80     *  As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     81     *  or open the local socket. You MUST call startRunning() for that.
     82     *
    8083     * @throws IllegalArgumentException if the I2PTunnel does not contain
    8184     *                                  valid config to contact the router
     
    9396
    9497        setName("HTTPS Proxy on " + tunnel.listenHost + ':' + localPort);
    95 
    96         startRunning();
    9798    }
    9899
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPBidirProxy.java

    r9dc2ae0 r485acd6c  
    3131
    3232    /**
     33     *  As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     34     *  or open the local socket. You MUST call startRunning() for that.
     35     *
    3336     * @throws IllegalArgumentException if the I2PTunnel does not contain
    3437     *                                  valid config to contact the router
     
    3942
    4043        setName(getLocalPort() + " -> HTTPClient [NO PROXIES]");
    41         startRunning();
    42 
    4344        notifyEvent("openHTTPClientResult", "ok");
    4445    }
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPBidirServer.java

    r9dc2ae0 r485acd6c  
    3333
    3434        /* start the httpclient */
    35         task = new I2PTunnelHTTPBidirProxy(localPort, l, sockMgr, getTunnel(), getEventDispatcher(), __serverId);
     35        I2PTunnelClientBase client = new I2PTunnelHTTPBidirProxy(localPort, l, sockMgr, getTunnel(), getEventDispatcher(), __serverId);
     36        client.startRunning();
     37        task = client;
    3638        sockMgr.setName("Server"); // TO-DO: Need to change this to "Bidir"!
    3739        getTunnel().addSession(sockMgr.getSession());
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    r9dc2ae0 r485acd6c  
    193193     *  It is used to add a client to an existing socket manager.
    194194     *
     195     *  As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     196     *  or open the local socket. You MUST call startRunning() for that.
     197     *
    195198     *  @param sockMgr the existing socket manager
    196199     */
     
    201204
    202205        setName("HTTP Proxy on " + getTunnel().listenHost + ':' + localPort);
    203         startRunning();
    204 
    205206        notifyEvent("openHTTPClientResult", "ok");
    206207    }
    207208
    208209    /**
     210     *  As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     211     *  or open the local socket. You MUST call startRunning() for that.
     212     *
    209213     * @throws IllegalArgumentException if the I2PTunnel does not contain
    210214     *                                  valid config to contact the router
     
    226230
    227231        setName("HTTP Proxy on " + tunnel.listenHost + ':' + localPort);
    228 
    229         startRunning();
    230 
    231232        notifyEvent("openHTTPClientResult", "ok");
    232233    }
     
    608609                                                           "</p>").getBytes("UTF-8"));
    609610                                                writeFooter(out);
     611                                                reader.drain();
    610612                                                // XXX: should closeSocket(s) be in a finally block?
    611613                                            } catch (IOException ioe) {
     
    722724                            writeFooter(out);
    723725                            reader.drain();
    724                             s.close();
    725726                        } catch (IOException ioe) {
    726727                            // ignore
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java

    r9dc2ae0 r485acd6c  
    4242
    4343    /**
     44     *  As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     45     *  or open the local socket. You MUST call startRunning() for that.
     46     *
    4447     * @param destinations peers we target, comma- or space-separated. Since 0.9.9, each dest may be appended with :port
    4548     * @throws IllegalArgumentException if the I2PTunnel does not contain
     
    8184        _dccEnabled = Boolean.parseBoolean(tunnel.getClientOptions().getProperty(PROP_DCC));
    8285        // TODO add some prudent tunnel options (or is it too late?)
    83 
    84         startRunning();
    8586
    8687        notifyEvent("openIRCClientResult", "ok");
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/DCCClientManager.java

    r9dc2ae0 r485acd6c  
    110110                                                                _dispatch, _tunnel, ++_id);
    111111            cTunnel.attachEventDispatcher(this);
     112            cTunnel.startRunning();
    112113            int lport = cTunnel.getLocalPort();
    113114            if (_log.shouldLog(Log.WARN))
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/I2PTunnelDCCClient.java

    r9dc2ae0 r485acd6c  
    3838
    3939    /**
     40     * As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     41     * or open the local socket. You MUST call startRunning() for that.
     42     *
    4043     * @param dest the target, presumably b32
    4144     * @param localPort if 0, use any port, get actual port selected with getLocalPort()
     
    5255
    5356        setName("DCC send -> " + dest + ':' + remotePort);
    54 
    55         startRunning();
    5657    }
    5758
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/I2PSOCKSTunnel.java

    r9dc2ae0 r485acd6c  
    3434    //}
    3535
    36     /** @param pkf private key file name or null for transient key */
     36    /**
     37     *  As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     38     *  or open the local socket. You MUST call startRunning() for that.
     39     *
     40     *  @param pkf private key file name or null for transient key
     41     */
    3742    public I2PSOCKSTunnel(int localPort, Logging l, boolean ownDest, EventDispatcher notifyThis, I2PTunnel tunnel, String pkf) {
    3843        super(localPort, ownDest, l, notifyThis, "SOCKS Proxy on " + tunnel.listenHost + ':' + localPort, tunnel, pkf);
     
    4550        setName("SOCKS Proxy on " + tunnel.listenHost + ':' + localPort);
    4651        parseOptions();
    47         startRunning();
    48 
    4952        notifyEvent("openSOCKSTunnelResult", "ok");
    5053    }
Note: See TracChangeset for help on using the changeset viewer.