Changeset 6c3cf9bf for apps


Ignore:
Timestamp:
Jul 15, 2018 1:50:31 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
63f4e04
Parents:
4ff62c2
Message:

I2CP: Add option for forcing gzip on/off per-message
Use option in streaming SYN and CLOSE packets

File:
1 edited

Legend:

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

    r4ff62c2 r6c3cf9bf  
    148148                options.setTagsToSend(sendTags);
    149149                options.setTagThreshold(tagThresh);
     150                // CLOSE, RESET, and PING packets unlikely to have a large payload
     151                // and most of the rest of the packet is
     152                // uncompressible: stream ids, signature
     153                options.setGzip(packet.getPayloadSize() > 50);
    150154            } else if (packet.isFlagSet(FLAGS_INITIAL_TAGS)) {
    151155                if (con != null) {
     
    168172                options.setTagsToSend(sendTags);
    169173                options.setTagThreshold(tagThresh);
     174                // SYN packets are likely to have compressible payload, even if
     175                // conn gzip option is false (e.g. snark bitfield, HTTP headers).
     176                // If they don't have a large payload, most of the rest of the packet
     177                // is uncompressible: stream ids, destination and signature
     178                options.setGzip(packet.getPayloadSize() > 50);
    170179            } else {
    171180                if (con != null) {
Note: See TracChangeset for help on using the changeset viewer.