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:
Marten Seemann
2017-10-02 18:16:27 -07:00
parent 52ed5579f7
commit a8b603b7bf
7 changed files with 53 additions and 90 deletions

View File

@@ -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(),