From 4eb70e97f4796b72d55ab0a14d529a55eb6bbcfc Mon Sep 17 00:00:00 2001 From: zzz Date: Sat, 21 Sep 2024 13:50:45 -0400 Subject: [PATCH] streaming: Allow i2p.streaming.profile != 1 previously threw an exception even though value was mostly ignored and never set by i2ptunnel. i2pd plans to start using this option. Do not set profile flag in streaming header, it is unused. --- .../client/streaming/impl/ConnectionDataReceiver.java | 4 +++- .../i2p/client/streaming/impl/ConnectionOptions.java | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionDataReceiver.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionDataReceiver.java index 89a8f82ec2..7fa5be8390 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionDataReceiver.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionDataReceiver.java @@ -196,11 +196,13 @@ class ConnectionDataReceiver implements MessageOutputStream.DataReceiver { // bugfix release 0.7.8, we weren't dividing by 1000 packet.setResendDelay(_connection.getOptions().getResendDelay() / 1000); +/* if (_connection.getOptions().getProfile() == ConnectionOptions.PROFILE_INTERACTIVE) packet.setFlag(Packet.FLAG_PROFILE_INTERACTIVE, true); else packet.setFlag(Packet.FLAG_PROFILE_INTERACTIVE, false); - +*/ + //if ( (!ackOnly) && (packet.getSequenceNum() <= 0) ) { if (isFirst) { packet.setFlag(Packet.FLAG_SYNCHRONIZE); diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java index 398590d246..c2a1e5a03a 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java @@ -814,9 +814,15 @@ class ConnectionOptions extends I2PSocketOptionsImpl { * @return the profile of the connection. */ public int getProfile() { return _profile; } + + + /** + * Set the profile for this connection. + * Through API 0.9.63, threw an IllegalArgumentException for any value !=1. + * As of API 0.9.64, all values are saved. + * Warning: unused. + */ public void setProfile(int profile) { - if (profile != PROFILE_BULK) - throw new IllegalArgumentException("Only bulk is supported so far"); _profile = profile; }