forked from quic-go/quic-go
connection parameter manager docs
This commit is contained in:
@@ -11,9 +11,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ConnectionParametersManager stores the connection parameters
|
// ConnectionParametersManager stores the connection parameters
|
||||||
|
// Warning: Writes may only be done from the crypto stream, see the comment
|
||||||
|
// in GetSHLOMap().
|
||||||
type ConnectionParametersManager struct {
|
type ConnectionParametersManager struct {
|
||||||
params map[Tag][]byte
|
params map[Tag][]byte
|
||||||
// TODO: We can probably remove this mutex.
|
|
||||||
mutex sync.RWMutex
|
mutex sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +57,9 @@ func (h *ConnectionParametersManager) GetRawValue(tag Tag) ([]byte, error) {
|
|||||||
|
|
||||||
// GetSHLOMap gets all values (except crypto values) needed for the SHLO
|
// GetSHLOMap gets all values (except crypto values) needed for the SHLO
|
||||||
func (h *ConnectionParametersManager) GetSHLOMap() map[Tag][]byte {
|
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
|
return h.params
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user