Changeset e64ad7c


Ignore:
Timestamp:
Aug 26, 2018 3:13:49 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
c9002b32, f6c4535
Parents:
1f92232
Message:

More findbugs all over

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • apps/addressbook/java/src/net/i2p/addressbook/Daemon.java

    r1f92232 re64ad7c  
    177177                               NamingService publishedNS, AddressBook addressbook,
    178178                               Iterator<Map.Entry<String, HostTxtEntry>> iter, Log log) {
    179             long start = System.currentTimeMillis();
     179            long start = DEBUG ? System.currentTimeMillis() : 0;
    180180            int old = 0, nnew = 0, invalid = 0, conflict = 0, total = 0;
    181181            int deleted = 0;
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigAdvancedHandler.java

    r1f92232 re64ad7c  
    108108        if (_ff.equals("false") || _ff.equals("true")) {
    109109            FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
    110             boolean wasFF = fndf.floodfillEnabled();
    111110            boolean isFF = _ff.equals("true");
    112111            // this will rebuild the RI, log in the event log, etc.
  • apps/streaming/java/src/net/i2p/client/streaming/impl/PacketHandler.java

    r1f92232 re64ad7c  
    282282                        if (_log.shouldLog(Log.INFO))
    283283                            _log.info("Received additional packet w/o SendStreamID after the syn on " + con + ": " + packet);
    284                         receiveKnownCon(con, packet);
    285                         return;
    286284                    } else {
    287285                        if (_log.shouldLog(Log.WARN))
    288286                            _log.warn("hrmph, received while ack of syn was in flight on " + con + ": " + packet + " acked: " + con.getAckedPackets());
    289287                        // allow unlimited packets without a SendStreamID for now
    290                         receiveKnownCon(con, packet);
    291                         return;
    292                     }
     288                    }
     289                    receiveKnownCon(con, packet);
     290                    return;
    293291                }
    294292            } else {
     
    300298                }
    301299                // don't bother sending reset
     300                // TODO send reset if recent && has data?
    302301                packet.releasePayload();
    303302                return;
  • apps/susimail/src/src/i2p/susi/webmail/WebMail.java

    r1f92232 re64ad7c  
    26232623                ArrayList<String> bccList = new ArrayList<String>();
    26242624               
    2625                 String sender = null;
    2626                 if (from != null && Mail.validateAddress(from)) {
    2627                         sender = Mail.getAddress( from );
    2628                 }
    2629                
    26302625                // no validation
    26312626                Mail.getRecipientsFromList( toList, to, ok );
     
    27322727                String[] bcc = draft.getBcc();
    27332728                String subject = draft.subject;
    2734                 MailPart text = draft.getPart();
    27352729                List<Attachment> attachments = draft.getAttachments();
    27362730
     
    29732967                        I2PAppContext ctx = I2PAppContext.getGlobalContext();
    29742968                        b64UIDL = Base64.encode(ctx.random().nextLong() + "drft");
    2975                 } else {
     2969                }
     2970
    29762971                        MailCache drafts = sessionObject.caches.get(DIR_DRAFTS);
    29772972                        if (drafts == null) {
     
    30083003                                out.println("<input type=\"hidden\" name=\"" + DRAFT_EXISTS + "\" value=\"1\">");
    30093004                        }
    3010                 }
    30113005
    30123006                boolean fixed = Boolean.parseBoolean(Config.getProperty( CONFIG_SENDER_FIXED, "true" ));
  • core/java/src/gnu/crypto/prng/FortunaStandalone.java

    r1f92232 re64ad7c  
    110110  int pool0Count;
    111111  int reseedCount;
    112   static long refillCount = 0;
    113   static long lastRefill = System.currentTimeMillis();
     112  //static long refillCount = 0;
     113  //static long lastRefill = System.currentTimeMillis();
    114114
    115115  public static final String SEED = "gnu.crypto.prng.fortuna.seed";
     
    127127    allocBuffer();
    128128  }
     129
     130  /** Unused, see AsyncFortunaStandalone */
    129131  protected void allocBuffer() {
    130132    buffer = new byte[4*1024*1024]; //256]; // larger buffer to reduce churn
    131133  }
    132134
     135  /** Unused, see AsyncFortunaStandalone */
    133136  public void seed(byte val[]) {
    134137      Map<String, byte[]> props = Collections.singletonMap(SEED, val);
     
    146149  }
    147150
     151  /** Unused, see AsyncFortunaStandalone */
    148152  public void fillBlock()
    149153  {
    150     long start = System.currentTimeMillis();
     154    //long start = System.currentTimeMillis();
    151155    if (pool0Count >= MIN_POOL_SIZE
    152156        && System.currentTimeMillis() - lastReseed > 100)
     
    163167      }
    164168    generator.nextBytes(buffer);
    165     long now = System.currentTimeMillis();
    166     long diff = now-lastRefill;
    167     lastRefill = now;
    168     long refillTime = now-start;
    169     System.out.println("Refilling " + (++refillCount) + " after " + diff + " for the PRNG took " + refillTime);
     169    //long now = System.currentTimeMillis();
     170    //long diff = now-lastRefill;
     171    //lastRefill = now;
     172    //long refillTime = now-start;
     173    //System.out.println("Refilling " + (++refillCount) + " after " + diff + " for the PRNG took " + refillTime);
    170174  }
    171175
  • core/java/src/net/i2p/client/naming/MetaNamingService.java

    r1f92232 re64ad7c  
    214214    public void export(Writer out, Properties options) throws IOException {
    215215        for (NamingService ns : _services) {
    216              export(out, options);
     216             ns.export(out, options);
    217217        }
    218218    }
  • router/java/src/net/i2p/router/Blocklist.java

    r1f92232 re64ad7c  
    423423        //    end1--;
    424424        //}
    425         if (end1 <= 0)
    426             return null;  // blank
     425        //if (end1 <= 0)
     426        //    return null;  // blank
    427427        int start2 = -1;
    428428        int mask = -1;
  • router/java/src/net/i2p/router/networkdb/kademlia/StoreJob.java

    r1f92232 re64ad7c  
    496496   
    497497            if (_log.shouldLog(Log.DEBUG)) {
    498                 if (shouldEncrypt)
    499                     _log.debug("sending encrypted store to " + peer.getIdentity().getHash() + " through " + outTunnel + ": " + sent);
    500                 else
    501                     _log.debug("sending store to " + peer.getIdentity().getHash() + " through " + outTunnel + ": " + sent);
    502                 //_log.debug("Expiration is " + new Date(sent.getMessageExpiration()));
     498                _log.debug("sending encrypted store to " + peer.getIdentity().getHash() + " through " + outTunnel + ": " + sent);
    503499            }
    504500            getContext().messageRegistry().registerPending(selector, onReply, onFail);
  • router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java

    r1f92232 re64ad7c  
    982982        Block block = new NTCP2Payload.RIBlock(ri, shouldFlood);
    983983        int size = block.getTotalLength();
    984         if (size > BUFFER_SIZE) {
     984        if (size + NTCP2Payload.BLOCK_HEADER_SIZE > BUFFER_SIZE) {
    985985            if (_log.shouldWarn())
    986986                _log.warn("RI too big: " + ri);
     
    994994            //block = new NTCP2Payload.PaddingBlock(_context, padlen);
    995995            block = new NTCP2Payload.PaddingBlock(padlen);
    996             size += block.getTotalLength();
    997996            blocks.add(block);
    998997        }
     
    10411040            //block = new NTCP2Payload.PaddingBlock(_context, padlen);
    10421041            block = new NTCP2Payload.PaddingBlock(padlen);
    1043             plen += block.getTotalLength();
    10441042            blocks.add(block);
    10451043        }
  • router/java/src/net/i2p/router/transport/udp/PeerState.java

    r1f92232 re64ad7c  
    19051905            _context.statManager().addRateData("udp.sendConfirmVolley", numSends);
    19061906            _transport.succeeded(state);
    1907             int numFragments = state.getFragmentCount();
    19081907            // this adjusts the rtt/rto/window/etc
    19091908            messageACKed(state.getMessageSize(), state.getLifetime(), numSends);
  • router/java/src/net/i2p/router/tunnel/FragmentedMessage.java

    r1f92232 re64ad7c  
    8888        if (fragmentNum > _highFragmentNum)
    8989            _highFragmentNum = fragmentNum;
    90         if (isLast && fragmentNum <= 0) {
    91             if (_log.shouldLog(Log.ERROR))
    92                 _log.error("hmm, isLast and fragmentNum=" + fragmentNum + " for message " + _messageId);
    93             return false;
    94         }
    9590        return true;
    9691    }
Note: See TracChangeset for help on using the changeset viewer.