// Fuzz fuzzes proxy.
554379
func Fuzz(data []byte) int {
	c := caddy.NewTestController("dns", "proxy . 8.8.8.8:53")
	up, err := NewStaticUpstreams(&c.Dispenser)
	if err != nil {
		return 0
	}
	p := &Proxy{Upstreams: &up}

	return fuzz.Do(p, data)
}
846792
func (q *TermQuery) Fuzziness(fuzziness int) *TermQuery {
	q.options["fuzziness"] = fuzziness
	return q
}
529748
func (cm *connectMethod) proxyAuth() string {
	if cm.proxyURL == nil {
		return ""
	}
	if u := cm.proxyURL.User; u != nil {
		return "Basic " + base64.URLEncoding.EncodeToString([]byte(u.String()))
	}
	return ""
}
1343228
func (c *xContext) Proxy() []string {
	if ips := c.Header(`X-Forwarded-For`); len(ips) > 0 {
		return strings.Split(ips, `,`)
	}
	return []string{}
}
563150
func (b *HttpRequest) SetProxy(proxy func(*http.Request) (*url.URL, error)) *HttpRequest {
	b.setting.Proxy = proxy
	return b
}
45355
func (a *Agent) RemoveProxy(proxyID string, persist bool) error {
	a.stateLock.Lock()
	defer a.stateLock.Unlock()
	return a.removeProxyLocked(proxyID, persist)
}
1018701
func FuzzyAfter(d, fuzz time.Duration) <-chan time.Time {
	return time.After(FuzzyDuration(d, fuzz))
}
1272856
func (w *Wrapper) UpsertProxy(s services.Server) error {
	return w.Write.UpsertProxy(s)
}
347142
func (facade *Facade) Proxy() (bool, error) {
	var out params.SSHProxyResult
	err := facade.caller.FacadeCall("Proxy", nil, &out)
	if err != nil {
		return false, errors.Trace(err)
	}
	return out.UseProxy, nil
}
758669
func (pcond *ProxyConds) DoFunc(f func(resp *http.Response, ctx *ProxyCtx) *http.Response) {
	pcond.Do(FuncRespHandler(f))
}
1335196
func Fuzz(data []byte) int {
	parsed, err := parse(data)
	if err != nil {
		return 0
	}
	var w1 bytes.Buffer
	if err = write(parsed, &w1); err != nil {
		panic(err)
	}
	parsed, err = parse(w1.Bytes())
	if err != nil {
		panic(err)
	}
	var w2 bytes.Buffer
	if err = write(parsed, &w2); err != nil {
		panic(err)
	}
	if !bytes.Equal(w1.Bytes(), w2.Bytes()) {
		panic(fmt.Sprintf("reserialized data does not match:\n%q\n%q\n", w1.Bytes(), w2.Bytes()))
	}
	return 1
}
43511
func Fuzz(data []byte) int {
	if p, err := ReadPackageFile(bytes.NewReader(data)); err != nil {
		// handled errors are not very interesting
		return 0
	} else {
		// call some tag handlers
		_ = p.String()
		_ = p.Requires()
		_ = p.Conflicts()
		_ = p.Obsoletes()
		_ = p.Provides()

		// read all index values
		for _, h := range p.Headers {
			for _, x := range h.Indexes {
				switch x.Type {
				case IndexDataTypeBinary:
					_ = h.Indexes.BytesByTag(x.Tag)

				case IndexDataTypeChar, IndexDataTypeInt8, IndexDataTypeInt16, IndexDataTypeInt32, IndexDataTypeInt64:
					_ = h.Indexes.IntsByTag(x.Tag)
					_ = h.Indexes.IntByTag(x.Tag)

				case IndexDataTypeString, IndexDataTypeI8NString, IndexDataTypeStringArray:
					_ = h.Indexes.StringsByTag(x.Tag)
					_ = h.Indexes.StringByTag(x.Tag)
				}
			}
		}

		// everything worked with random input... interesting :|
		return 1
	}
}
1026110
func ProxyURL(fixedURL *url.URL) func(*http.Request) (*url.URL, error) {
	return func(*http.Request) (*url.URL, error) {
		return fixedURL, nil
	}
}
753915
func Fuzz(data []byte) int {
	c := caddy.NewTestController("dns", "rewrite edns0 subnet set 24 56")
	rules, err := rewriteParse(c)
	if err != nil {
		return 0
	}
	r := Rewrite{Rules: rules}

	return fuzz.Do(r, data)
}
532018
func DefaultFuzzConnConfig() *FuzzConnConfig {
	return &FuzzConnConfig{
		Mode:         FuzzModeDrop,
		MaxDelay:     3 * time.Second,
		ProbDropRW:   0.2,
		ProbDropConn: 0.00,
		ProbSleep:    0.00,
	}
}
970152
func Fuzz(data []byte) int {
	c := Chaos{}
	return fuzz.Do(c, data)
}
463396
func (f *Forward) SetProxy(p *Proxy) {
	f.proxies = append(f.proxies, p)
	p.start(f.hcInterval)
}