Changeset 7544d0a


Ignore:
Timestamp:
Feb 7, 2019 6:14:18 PM (20 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3ba0fcf
Parents:
636016d1
Message:

Streaming: Fix exception after sig verify fail
log tweaks

Location:
apps/streaming/java/src/net/i2p/client/streaming/impl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/src/net/i2p/client/streaming/impl/Connection.java

    r636016d1 r7544d0a  
    914914    /**
    915915     *  @param id 0 to 0xffffffff
    916      *  @throws RuntimeException if already set to nonzero
     916     *  @throws IllegalStateException if already set to nonzero
    917917     */
    918918    public void setSendStreamId(long id) {
    919919        if (!_sendStreamId.compareAndSet(0, id))
    920             throw new RuntimeException("Send stream ID already set [" + _sendStreamId + ", " + id + "]");
     920            throw new IllegalStateException("Send stream ID already set [" + _sendStreamId + ", " + id + "]");
    921921    }
    922922   
     
    929929    /**
    930930     *  @param id 0 to 0xffffffff
    931      *  @throws RuntimeException if already set to nonzero
     931     *  @throws IllegalStateException if already set to nonzero
    932932     */
    933933    public void setReceiveStreamId(long id) {
    934934        if (!_receiveStreamId.compareAndSet(0, id))
    935             throw new RuntimeException("Receive stream ID already set [" + _receiveStreamId + ", " + id + "]");
     935            throw new IllegalStateException("Receive stream ID already set [" + _receiveStreamId + ", " + id + "]");
    936936        synchronized (_connectLock) { _connectLock.notifyAll(); }
    937937    }
  • apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionPacketHandler.java

    r636016d1 r7544d0a  
    573573            _cache.release(ba);
    574574            if (!ok) {
    575                 if (_log.shouldLog(Log.ERROR))
    576                     _log.error("Received unsigned / forged RST on " + con);
     575                if (_log.shouldWarn())
     576                    _log.warn("Received unsigned / forged RST on " + con);
    577577                return;
    578578            } else {
  • apps/streaming/java/src/net/i2p/client/streaming/impl/PacketHandler.java

    r636016d1 r7544d0a  
    205205                        if (_log.shouldWarn())
    206206                            _log.warn("Sig verify fail for " + con + "/" + oldId + ": " + packet, ie);
    207                         con.setSendStreamId(oldId);
     207                        // TODO we can't set the stream ID back to 0, throws ISE
     208                        //con.setSendStreamId(oldId);
    208209                        if (packet.isFlagSet(Packet.FLAG_SYNCHRONIZE)) {
    209210                            // send a reset, it's a known con, so it's unlikely to be spoofed
  • apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java

    r636016d1 r7544d0a  
    7272     */
    7373    public void setOptionalFrom() {
    74         setFlag(FLAG_FROM_INCLUDED, true);
     74        setFlag(FLAG_FROM_INCLUDED);
    7575        _optionFrom = _session.getMyDestination();
    7676        if (_session.isOffline()) {
    77             setFlag(FLAG_SIGNATURE_OFFLINE, true);
     77            setFlag(FLAG_SIGNATURE_OFFLINE);
    7878            _transientExpires = _session.getOfflineExpiration();
    7979            _transientSigningPublicKey = _session.getTransientSigningPublicKey();
Note: See TracChangeset for help on using the changeset viewer.