Changeset 0d212f6


Ignore:
Timestamp:
Jul 28, 2011 6:23:27 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
59e1fbd
Parents:
3a1cd51b
Message:

dont throw when setting to the same value

File:
1 edited

Legend:

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

    r3a1cd51b r0d212f6  
    152152   
    153153    private boolean _sendStreamIdSet = false;
     154
    154155    /** what stream do we send data to the peer on?
    155156     * @return stream ID we use to send data
    156157     */
    157158    public long getSendStreamId() { return _sendStreamId; }
     159
    158160    public void setSendStreamId(long id) {
    159         if ( (_sendStreamIdSet) && (_sendStreamId > 0) )
     161        // allow resetting to the same id (race)
     162        if ( (_sendStreamIdSet) && (_sendStreamId > 0) && _sendStreamId != id)
    160163            throw new RuntimeException("Send stream ID already set [" + _sendStreamId + ", " + id + "]");
    161164        _sendStreamIdSet = true;
     
    164167   
    165168    private boolean _receiveStreamIdSet = false;
     169
    166170    /**
    167171     * stream the replies should be sent on.  this should be 0 if the
     
    170174     */
    171175    public long getReceiveStreamId() { return _receiveStreamId; }
     176
    172177    public void setReceiveStreamId(long id) {
    173         if ( (_receiveStreamIdSet) && (_receiveStreamId > 0) )
     178        // allow resetting to the same id (race)
     179        if ( (_receiveStreamIdSet) && (_receiveStreamId > 0) && _receiveStreamId != id)
    174180            throw new RuntimeException("Receive stream ID already set [" + _receiveStreamId + ", " + id + "]");
    175181        _receiveStreamIdSet = true;
Note: See TracChangeset for help on using the changeset viewer.