Changeset a44e752


Ignore:
Timestamp:
Apr 21, 2013 3:40:08 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
60d0b29
Parents:
d0fa9f8
Message:
  • Streaming: Pcap window size fixes
Location:
apps/streaming/java/src/net/i2p/client/streaming
Files:
2 edited

Legend:

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

    rd0fa9f8 ra44e752  
    102102        Connection con = (sendId > 0 ? _manager.getConnectionByInboundId(sendId) : null);
    103103        if (con != null) {
    104             receiveKnownCon(con, packet);
    105104            if (_log.shouldLog(Log.INFO))
    106105                displayPacket(packet, "RECV", "wsize " + con.getOptions().getWindowSize() + " rto " + con.getOptions().getRTO());
     106            receiveKnownCon(con, packet);
    107107        } else {
    108108            receiveUnknownCon(packet, sendId, queueIfNoConn);
  • apps/streaming/java/src/net/i2p/client/streaming/PcapWriter.java

    rd0fa9f8 ra44e752  
    266266        long msgSize = ConnectionOptions.DEFAULT_MAX_MESSAGE_SIZE;
    267267        if (con != null) {
     268            // calculate the receive window, which doesn't have an exact streaming equivalent
    268269            if (isInbound) {
     270                // Inbound pkt: his rcv buffer ~= our outbound window
    269271                // try to represent what he thinks the window is, we don't really know
    270272                // this isn't really right, the lastsendid can get way ahead
    271                 window = acked + con.getOptions().getWindowSize() - con.getLastSendId();
     273                window = con.getLastSendId() + con.getOptions().getWindowSize() - acked;
    272274            } else {
     275                // Ourbound pkt: our rcv buffer ~= his outbound window
     276                // TODO just use a recent high unackedIn count?
    273277                // following is from ConnectionPacketHandler
     278                // this is not interesting, we have lots of buffers
    274279                long ready = con.getInputStream().getHighestReadyBockId();
    275280                int available = con.getOptions().getInboundBufferSize() - con.getInputStream().getTotalReadySize();
     
    277282                window = (ready + allowedBlocks) - pkt.getSequenceNum();
    278283            }
    279             if (window < 0)
    280                 window = 0;
     284            if (window <= 1)
     285                window = 2; // TCP min
    281286            msgSize = con.getOptions().getMaxMessageSize();
    282287        }
Note: See TracChangeset for help on using the changeset viewer.