Changeset c92c664


Ignore:
Timestamp:
Dec 13, 2011 8:38:02 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
60297f56
Parents:
24c1473
Message:

used cached cert; generics

Location:
router/java/src/net/i2p/router/message
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/message/CloveSet.java

    r24c1473 rc92c664  
    2020 */
    2121class CloveSet {
    22     private final List _cloves;
     22    private final List<GarlicClove> _cloves;
    2323    private Certificate _cert;
    2424    private long _msgId;
     
    3333    public int getCloveCount() { return _cloves.size(); }
    3434    public void addClove(GarlicClove clove) { _cloves.add(clove); }
    35     public GarlicClove getClove(int index) { return (GarlicClove)_cloves.get(index); }
     35    public GarlicClove getClove(int index) { return _cloves.get(index); }
    3636   
    3737    public Certificate getCertificate() { return _cert; }
     
    4747        buf.append("{");
    4848        for (int i = 0; i < _cloves.size(); i++) {
    49             GarlicClove clove = (GarlicClove)_cloves.get(i);
     49            GarlicClove clove = _cloves.get(i);
    5050            if (clove.getData() != null)
    5151                buf.append(clove.getData().getClass().getName()).append(", ");
  • router/java/src/net/i2p/router/message/GarlicConfig.java

    r24c1473 rc92c664  
    2828    private long _id;
    2929    private long _expiration;
    30     private final List _cloveConfigs;
     30    private final List<GarlicConfig> _cloveConfigs;
    3131    private DeliveryInstructions _instructions;
    3232    private boolean _requestAck;
     
    143143    }
    144144    public int getCloveCount() { return _cloveConfigs.size(); }
    145     public GarlicConfig getClove(int index) { return (GarlicConfig)_cloveConfigs.get(index); }
     145    public GarlicConfig getClove(int index) { return _cloveConfigs.get(index); }
    146146    public void clearCloves() { _cloveConfigs.clear(); }
    147147   
  • router/java/src/net/i2p/router/message/GarlicMessageParser.java

    r24c1473 rc92c664  
    4747        }
    4848        if (decrData == null) {
    49             if (_log.shouldLog(Log.WARN))
    50                 _log.warn("Decryption of garlic message failed", new Exception("Decrypt fail"));
     49            // This is the usual error path and it's logged at WARN level in GarlicMessageReceiver
     50            if (_log.shouldLog(Log.INFO))
     51                _log.info("Decryption of garlic message failed", new Exception("Decrypt fail"));
    5152            return null;
    5253        } else {
     
    7980                _log.debug("After reading clove " + i);
    8081        }
    81         Certificate cert = new Certificate();
    82         offset += cert.readBytes(data, offset);
     82        //Certificate cert = new Certificate();
     83        //offset += cert.readBytes(data, offset);
     84        Certificate cert = Certificate.create(data, offset);
     85        offset += cert.size();
    8386        long msgId = DataHelper.fromLong(data, offset, 4);
    8487        offset += 4;
    8588        Date expiration = DataHelper.fromDate(data, offset);
    86         offset += DataHelper.DATE_LENGTH;
    8789
    8890        set.setCertificate(cert);
Note: See TracChangeset for help on using the changeset viewer.