Streaming: Don't always send optional delay (ticket #1046)

javadocs
This commit is contained in:
zzz
2017-02-05 14:55:13 +00:00
parent 83c786a5fd
commit a85546534e
2 changed files with 12 additions and 1 deletions

View File

@ -388,7 +388,7 @@ class Connection {
_log.debug("Requesting ack delay of " + delay + "ms for packet " + packet); _log.debug("Requesting ack delay of " + delay + "ms for packet " + packet);
} }
// WHY always set? // WHY always set?
packet.setFlag(Packet.FLAG_DELAY_REQUESTED); //packet.setFlag(Packet.FLAG_DELAY_REQUESTED);
long timeout = _options.getRTO(); long timeout = _options.getRTO();
if (timeout > MAX_RESEND_DELAY) if (timeout > MAX_RESEND_DELAY)

View File

@ -333,6 +333,9 @@ class Packet {
*/ */
public Signature getOptionalSignature() { return _optionSignature; } public Signature getOptionalSignature() { return _optionSignature; }
/**
* This also sets flag FLAG_SIGNATURE_INCLUDED
*/
public void setOptionalSignature(Signature sig) { public void setOptionalSignature(Signature sig) {
setFlag(FLAG_SIGNATURE_INCLUDED, sig != null); setFlag(FLAG_SIGNATURE_INCLUDED, sig != null);
_optionSignature = sig; _optionSignature = sig;
@ -346,6 +349,7 @@ class Packet {
/** /**
* This sets the from field in the packet to the Destination for the session * This sets the from field in the packet to the Destination for the session
* provided in the constructor. * provided in the constructor.
* This also sets flag FLAG_FROM_INCLUDED
*/ */
public void setOptionalFrom() { public void setOptionalFrom() {
setFlag(FLAG_FROM_INCLUDED, true); setFlag(FLAG_FROM_INCLUDED, true);
@ -360,6 +364,9 @@ class Packet {
*/ */
public int getOptionalDelay() { return _optionDelay; } public int getOptionalDelay() { return _optionDelay; }
/**
* Caller must also call setFlag(FLAG_DELAY_REQUESTED)
*/
public void setOptionalDelay(int delayMs) { public void setOptionalDelay(int delayMs) {
if (delayMs > MAX_DELAY_REQUEST) if (delayMs > MAX_DELAY_REQUEST)
_optionDelay = MAX_DELAY_REQUEST; _optionDelay = MAX_DELAY_REQUEST;
@ -375,6 +382,10 @@ class Packet {
* @return Maximum payload size sender can receive (MRU) * @return Maximum payload size sender can receive (MRU)
*/ */
public int getOptionalMaxSize() { return _optionMaxSize; } public int getOptionalMaxSize() { return _optionMaxSize; }
/**
* This also sets flag FLAG_MAX_PACKET_SIZE_INCLUDED
*/
public void setOptionalMaxSize(int numBytes) { public void setOptionalMaxSize(int numBytes) {
setFlag(FLAG_MAX_PACKET_SIZE_INCLUDED, numBytes > 0); setFlag(FLAG_MAX_PACKET_SIZE_INCLUDED, numBytes > 0);
_optionMaxSize = numBytes; _optionMaxSize = numBytes;