Changeset c02711c


Ignore:
Timestamp:
Jan 23, 2009 2:23:13 AM (12 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f7170aa
Parents:
9885779
Message:

Fix socks so it uses existing tunnels rather than building a new one for every request.
Now works with or without 'shared clients' enabled.

Location:
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks
Files:
2 edited

Legend:

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

    r9885779 rc02711c  
    4747            SOCKSServer serv = SOCKSServerFactory.createSOCKSServer(s);
    4848            Socket clientSock = serv.getClientSocket();
    49             I2PSocket destSock = serv.getDestinationI2PSocket();
     49            I2PSocket destSock = serv.getDestinationI2PSocket(this);
    5050            new I2PTunnelRunner(clientSock, destSock, sockLock, null, mySockets);
    5151        } catch (SOCKSException e) {
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java

    r9885779 rc02711c  
    6060     * @return an I2PSocket connected with the destination
    6161     */
    62     public I2PSocket getDestinationI2PSocket() throws SOCKSException {
     62    public I2PSocket getDestinationI2PSocket(I2PSOCKSTunnel t) throws SOCKSException {
    6363        setupServer();
    6464
     
    8080            if (connHostName.toLowerCase().endsWith(".i2p")) {
    8181                _log.debug("connecting to " + connHostName + "...");
    82                 I2PSocketManager sm = I2PSocketManagerFactory.createManager();
    83                 destSock = sm.connect(I2PTunnel.destFromName(connHostName), null);
     82                // Let's not due a new Dest for every request, huh?
     83                //I2PSocketManager sm = I2PSocketManagerFactory.createManager();
     84                //destSock = sm.connect(I2PTunnel.destFromName(connHostName), null);
     85                // TODO get the streaming lib options in there
     86                destSock = t.createI2PSocket(I2PTunnel.destFromName(connHostName));
    8487                confirmConnection();
    8588                _log.debug("connection confirmed - exchanging data...");
Note: See TracChangeset for help on using the changeset viewer.