forked from quic-go/quic-go
don't negotiate the idle timeout
The idle timeout doesn't need to be negotiated, simply announcing it to the peer is sufficient. We now close the session if there's no incoming network activity for the duration of the local idle timeout, and we send a PING frame after half the remote idle timeout (if keep alives are enabled).
This commit is contained in:
@@ -61,7 +61,7 @@ func (h *paramsNegotiatorGQUIC) SetFromMap(params map[Tag][]byte) error {
|
||||
if err != nil {
|
||||
return errMalformedTag
|
||||
}
|
||||
h.idleConnectionStateLifetime = h.negotiateIdleConnectionStateLifetime(time.Duration(clientValue) * time.Second)
|
||||
h.remoteIdleTimeout = time.Duration(clientValue) * time.Second
|
||||
}
|
||||
if value, ok := params[TagSFCW]; ok {
|
||||
if h.flowControlNegotiated {
|
||||
@@ -104,7 +104,7 @@ func (h *paramsNegotiatorGQUIC) GetHelloMap() (map[Tag][]byte, error) {
|
||||
mids := bytes.NewBuffer([]byte{})
|
||||
utils.LittleEndian.WriteUint32(mids, protocol.MaxIncomingDynamicStreamsPerConnection)
|
||||
icsl := bytes.NewBuffer([]byte{})
|
||||
utils.LittleEndian.WriteUint32(icsl, uint32(h.GetIdleConnectionStateLifetime()/time.Second))
|
||||
utils.LittleEndian.WriteUint32(icsl, uint32(h.idleTimeout/time.Second))
|
||||
|
||||
return map[Tag][]byte{
|
||||
TagICSL: icsl.Bytes(),
|
||||
|
||||
Reference in New Issue
Block a user