// Converts byte slice of SETTINGS frame payload into http2.Setting slice.
6422
func ParseSettings(b []byte) []http2.Setting {
	var r []http2.Setting
	for i := 0; i < len(b)/6; i++ {
		r = append(r, http2.Setting{
			ID:  http2.SettingID(binary.BigEndian.Uint16(b[i*6:])),
			Val: binary.BigEndian.Uint32(b[i*6+2:]),
		})
	}
	return r
}
219190
func (b *HttpRequest) Setting(setting HttpSettings) *HttpRequest {
	b.setting = setting
	return b
}
1033193
func UnmarshalHandlerSettings(publicSettings, protectedSettings map[string]interface{}, publicV, protectedV interface{}) error {
	if err := unmarshalSettings(publicSettings, &publicV); err != nil {
		return fmt.Errorf("failed to unmarshal public settings: %v", err)
	}
	if err := unmarshalSettings(protectedSettings, &protectedV); err != nil {
		return fmt.Errorf("failed to unmarshal protected settings: %v", err)
	}
	return nil
}
272652
func (s *OutputGroupSettings) SetFrameCaptureGroupSettings(v *FrameCaptureGroupSettings) *OutputGroupSettings {
	s.FrameCaptureGroupSettings = v
	return s
}
192709
func (api *API) ZoneSSLSettings(zoneID string) (ZoneSSLSetting, error) {
	uri := "/zones/" + zoneID + "/settings/ssl"
	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return ZoneSSLSetting{}, errors.Wrap(err, errMakeRequestError)
	}
	var r ZoneSSLSettingResponse
	err = json.Unmarshal(res, &r)
	if err != nil {
		return ZoneSSLSetting{}, errors.Wrap(err, errUnmarshalError)
	}
	return r.Result, nil
}
667292
func (s *SnapshotCreateRepositoryService) Setting(name string, value interface{}) *SnapshotCreateRepositoryService {
	if s.settings == nil {
		s.settings = make(map[string]interface{})
	}
	s.settings[name] = value
	return s
}
448226
func (s *HlsCdnSettings) SetHlsWebdavSettings(v *HlsWebdavSettings) *HlsCdnSettings {
	s.HlsWebdavSettings = v
	return s
}
471986
func (api *API) ZoneSettings(zoneID string) (*ZoneSettingResponse, error) {
	uri := "/zones/" + zoneID + "/settings"
	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return nil, errors.Wrap(err, errMakeRequestError)
	}

	response := &ZoneSettingResponse{}
	err = json.Unmarshal(res, &response)
	if err != nil {
		return nil, errors.Wrap(err, errUnmarshalError)
	}

	return response, nil
}
898726
func ParseAccept2(header http.Header, key string) (specs []AcceptSpec) {
	for _, en := range ParseList(header, key) {
		v, p := parseValueAndParams(en)
		var spec AcceptSpec
		spec.Value = v
		spec.Q = 1.0
		if p != nil {
			if q, ok := p["q"]; ok {
				spec.Q, _ = expectQuality(q)
			}
		}
		if spec.Q < 0.0 {
			continue
		}
		specs = append(specs, spec)
	}

	return
}
57013
func (s *ArchiveContainerSettings) SetM2tsSettings(v *M2tsSettings) *ArchiveContainerSettings {
	s.M2tsSettings = v
	return s
}
856472
func BytesToJSONOptions(value []byte) (map[string]string, error) {
	if value == nil || len(value) == 0 {
		return nil, nil
	}
	m := make(map[string]string)
	if err := json.Unmarshal(value, &m); err != nil {
		return nil, err
	}
	return m, nil
}
845919
func (f linkFrame) Bytes() []byte {
  var buff bytes.Buffer
  // link frame protocol version
  buff.Write([]byte{0})
  // link frame packet count
  pkts := len(f)
  buff.Write([]byte{byte(pkts)})
  // for each packet
  for _, pkt := range f {
    // pack the packet int our buffer
    pktbuff := make([]byte, len(pkt) + 2)
    binary.BigEndian.PutUint16(pktbuff, uint16(len(pkt)))
    copy(pktbuff[2:], pkt[:])
    buff.Write(pktbuff)
  }
  return buff.Bytes()
}
1076913
func SetTransportDefaults(t *http.Transport) *http.Transport {
	t = SetOldTransportDefaults(t)
	// Allow clients to disable http2 if needed.
	if s := os.Getenv("DISABLE_HTTP2"); len(s) > 0 {
		klog.Infof("HTTP2 has been explicitly disabled")
	} else {
		if err := http2.ConfigureTransport(t); err != nil {
			klog.Warningf("Transport failed http2 configuration: %v", err)
		}
	}
	return t
}
1312117
func Convert_v1_RFC2307Config_To_config_RFC2307Config(in *v1.RFC2307Config, out *config.RFC2307Config, s conversion.Scope) error {
	return autoConvert_v1_RFC2307Config_To_config_RFC2307Config(in, out, s)
}
1270293
func SetDefaultSetting(setting HttpSettings) {
	settingMutex.Lock()
	defer settingMutex.Unlock()
	defaultSetting = setting
	if defaultSetting.ConnectTimeout == 0 {
		defaultSetting.ConnectTimeout = 60 * time.Second
	}
	if defaultSetting.ReadWriteTimeout == 0 {
		defaultSetting.ReadWriteTimeout = 60 * time.Second
	}
}
761436
func (p *WebPage) Settings() (WebPageSettings, error) {
	var resp struct {
		Settings webPageSettingsJSON `json:"settings"`
	}
	if err := p.ref.process.doJSON("POST", "/webpage/Settings", map[string]interface{}{"ref": p.ref.id}, &resp); err != nil {
		return WebPageSettings{}, err
	}
	return WebPageSettings{
		JavascriptEnabled:             resp.Settings.JavascriptEnabled,
		LoadImages:                    resp.Settings.LoadImages,
		LocalToRemoteURLAccessEnabled: resp.Settings.LocalToRemoteURLAccessEnabled,
		UserAgent:                     resp.Settings.UserAgent,
		Username:                      resp.Settings.Username,
		Password:                      resp.Settings.Password,
		XSSAuditingEnabled:            resp.Settings.XSSAuditingEnabled,
		WebSecurityEnabled:            resp.Settings.WebSecurityEnabled,
		ResourceTimeout:               time.Duration(resp.Settings.ResourceTimeout) * time.Millisecond,
	}, nil
}
1328332
func (it *FloatDecoder) SetBytes(b []byte) error {
	var v uint64
	if len(b) == 0 {
		v = uvnan
	} else {
		// first byte is the compression type.
		// we currently just have gorilla compression.
		it.br.Reset(b[1:])

		var err error
		v, err = it.br.ReadBits(64)
		if err != nil {
			return err
		}
	}

	// Reset all fields.
	it.val = v
	it.leading = 0
	it.trailing = 0
	it.b = b
	it.first = true
	it.finished = false
	it.err = nil

	return nil
}