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.
This commit is contained in:
zzz
2024-09-21 13:50:45 -04:00
parent afe0704e3b
commit 4eb70e97f4
2 changed files with 11 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}