mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 21:57:36 +03:00
connection parameter manager docs
This commit is contained in:
parent
7e0d59a5e6
commit
f7d3da74b7
1 changed files with 6 additions and 3 deletions
|
@ -11,10 +11,11 @@ import (
|
|||
)
|
||||
|
||||
// ConnectionParametersManager stores the connection parameters
|
||||
// Warning: Writes may only be done from the crypto stream, see the comment
|
||||
// in GetSHLOMap().
|
||||
type ConnectionParametersManager struct {
|
||||
params map[Tag][]byte
|
||||
// TODO: We can probably remove this mutex.
|
||||
mutex sync.RWMutex
|
||||
mutex sync.RWMutex
|
||||
}
|
||||
|
||||
// ErrTagNotInConnectionParameterMap is returned when a tag is not present in the connection parameters
|
||||
|
@ -56,7 +57,9 @@ func (h *ConnectionParametersManager) GetRawValue(tag Tag) ([]byte, error) {
|
|||
|
||||
// GetSHLOMap gets all values (except crypto values) needed for the SHLO
|
||||
func (h *ConnectionParametersManager) GetSHLOMap() map[Tag][]byte {
|
||||
// TODO: This races.
|
||||
// Since GetSHLOMap is only called from the crypto stream, and changes to
|
||||
// the params are only made by the crypto stream itself, there is no data race
|
||||
// here, and we need not copy the map.
|
||||
return h.params
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue