github.com/alejandroesc/spdy@v0.0.0-20200317064415-01a02f0eb389/spdy2/utils.go (about)

     1  // Copyright 2014 Jamie Hall. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package spdy2
     6  
     7  import (
     8  	"github.com/SlyMarbo/spdy/common"
     9  )
    10  
    11  // defaultServerSettings are used in initialising the connection.
    12  // It takes the max concurrent streams.
    13  func defaultServerSettings(m uint32) common.Settings {
    14  	return common.Settings{
    15  		common.SETTINGS_MAX_CONCURRENT_STREAMS: &common.Setting{
    16  			Flags: common.FLAG_SETTINGS_PERSIST_VALUE,
    17  			ID:    common.SETTINGS_MAX_CONCURRENT_STREAMS,
    18  			Value: m,
    19  		},
    20  	}
    21  }
    22  
    23  // defaultClientSettings are used in initialising the connection.
    24  // It takes the max concurrent streams.
    25  func defaultClientSettings(m uint32) common.Settings {
    26  	return common.Settings{
    27  		common.SETTINGS_MAX_CONCURRENT_STREAMS: &common.Setting{
    28  			ID:    common.SETTINGS_MAX_CONCURRENT_STREAMS,
    29  			Value: m,
    30  		},
    31  	}
    32  }