Changeset 400a35d


Ignore:
Timestamp:
Apr 10, 2004 6:47:15 AM (17 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0e880f2
Parents:
c47bfce
git-author:
shendaras <shendaras> (04/10/04 06:47:15)
git-committer:
zzz <zzz@…> (04/10/04 06:47:15)
Message:

Make the variable's purpose a little more obvious
(shendaras)

Location:
apps/httptunnel/java/src/net/i2p/httptunnel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/httptunnel/java/src/net/i2p/httptunnel/HTTPTunnel.java

    rc47bfce r400a35d  
    4242     * @param initialManagers a list of socket managers to use
    4343     * @param maxManagers how many managers to have in the cache
    44      * @param mcDonaldsMode whether to throw away a manager after use
     44     * @param shouldThrowAwayManagers whether to throw away a manager after use
    4545     * @param listenPort which port to listen on
    4646     */
    4747    public HTTPTunnel(I2PSocketManager[] initialManagers, int maxManagers,
    48                       boolean mcDonaldsMode, int listenPort) {
    49         this(initialManagers, maxManagers, mcDonaldsMode, listenPort,
     48                      boolean shouldThrowAwayManagers, int listenPort) {
     49        this(initialManagers, maxManagers, shouldThrowAwayManagers, listenPort,
    5050             "127.0.0.1", 7654);
    5151    }
     
    5656     * @param initialManagers a list of socket managers to use
    5757     * @param maxManagers how many managers to have in the cache
    58      * @param mcDonaldsMode whether to throw away a manager after use
     58     * @param shouldThrowAwayManagers whether to throw away a manager after use
    5959     * @param listenPort which port to listen on
    6060     * @param i2cpAddress the I2CP address
     
    6262     */
    6363    public HTTPTunnel(I2PSocketManager[] initialManagers, int maxManagers,
    64                       boolean mcDonaldsMode, int listenPort,
     64                      boolean shouldThrowAwayManagers, int listenPort,
    6565                      String i2cpAddress, int i2cpPort) {
    6666        SocketManagerProducer smp =
    6767            new SocketManagerProducer(initialManagers, maxManagers,
    68                                       mcDonaldsMode, i2cpAddress, i2cpPort);
     68                                      shouldThrowAwayManagers, i2cpAddress, i2cpPort);
    6969        new HTTPListener(smp, listenPort, "127.0.0.1");
    7070    }
     
    7878        String host = "127.0.0.1";
    7979        int port = 7654, max = 1;
    80         boolean mc = false;
     80        boolean throwAwayManagers = false;
    8181        if (args.length >1) {
    8282            if (args.length == 4) {
     
    9494        } else if (max <0) {
    9595            max = -max;
    96             mc = true;
     96            throwAwayManagers = true;
    9797        }
    98         new HTTPTunnel(null, max, mc, Integer.parseInt(args[0]), host, port);
     98        new HTTPTunnel(null, max, throwAwayManagers, Integer.parseInt(args[0]), host, port);
    9999    }
    100100           
  • apps/httptunnel/java/src/net/i2p/httptunnel/SocketManagerProducer.java

    rc47bfce r400a35d  
    1515    private String host;
    1616    private int maxManagers;
    17     private boolean mcDonalds;
     17    private boolean shouldThrowAwayManagers;
    1818
    1919    /**
     
    2121     * @param initialManagers a list of socket managers to use
    2222     * @param maxManagers how many managers to have in the cache
    23      * @param mcDonaldsMode whether to throw away a manager after use
     23     * @param shouldThrowAwayManagers whether to throw away a manager after use
    2424     * @param host which host to listen on
    2525     * @param port which port to listen on
     
    2727    public SocketManagerProducer(I2PSocketManager[] initialManagers,
    2828                                 int maxManagers,
    29                                  boolean mcDonaldsMode,
     29                                 boolean shouldThrowAwayManagers,
    3030                                 String host, int port) {
    3131        if (maxManagers < 1) {
     
    3434        this.host=host;
    3535        this.port=port;
    36         mcDonalds=mcDonaldsMode;
     36        this.shouldThrowAwayManagers=shouldThrowAwayManagers;
    3737        if (initialManagers != null) {
    3838            myManagers.addAll(Arrays.asList(initialManagers));
    3939        }
    4040        this.maxManagers=maxManagers;
    41         mcDonalds=mcDonaldsMode;
     41        this.shouldThrowAwayManagers=shouldThrowAwayManagers;
    4242        setDaemon(true);
    4343        start();
     
    5353                // without mcDonalds mode, we most probably need no
    5454                // new managers.
    55                 while (!mcDonalds && myManagers.size() == maxManagers) {
     55                while (!shouldThrowAwayManagers && myManagers.size() == maxManagers) {
    5656                    myWait();
    5757                }
     
    103103        int which = (int)(Math.random()*myManagers.size());
    104104        I2PSocketManager result = (I2PSocketManager) myManagers.get(which);
    105         if (mcDonalds) {
     105        if (shouldThrowAwayManagers) {
    106106            myManagers.remove(which);
    107107            notifyAll();
Note: See TracChangeset for help on using the changeset viewer.