Lines Matching refs:hc

18 	hc := &HubConnector{
28 hc.needMoreRepros = mgr.needMoreRepros
30 hc.loop()
52 func (hc *HubConnector) loop() {
56 corpus, repros := hc.mgr.getMinimizedCorpus()
57 hc.newRepros = append(hc.newRepros, repros...)
60 if hub, err = hc.connect(corpus); err != nil {
61 log.Logf(0, "failed to connect to hub at %v: %v", hc.cfg.HubAddr, err)
64 log.Logf(0, "connected to hub at %v, corpus %v", hc.cfg.HubAddr, len(corpus))
66 if err := hc.sync(hub, corpus); err != nil {
74 func (hc *HubConnector) connect(corpus [][]byte) (*rpctype.RPCClient, error) {
76 Client: hc.cfg.HubClient,
77 Key: hc.cfg.HubKey,
78 Manager: hc.cfg.Name,
79 Fresh: hc.fresh,
81 for _, id := range hc.enabledCalls {
82 a.Calls = append(a.Calls, hc.target.Syscalls[id].Name)
91 if err := rpctype.RPCCall(hc.cfg.HubAddr, "Hub.Connect", a, nil); err != nil {
94 hub, err := rpctype.NewRPCClient(hc.cfg.HubAddr)
98 hc.hubCorpus = hubCorpus
99 hc.fresh = false
103 func (hc *HubConnector) sync(hub *rpctype.RPCClient, corpus [][]byte) error {
105 Client: hc.cfg.HubClient,
106 Key: hc.cfg.HubKey,
107 Manager: hc.cfg.Name,
113 if hc.hubCorpus[sig] {
116 hc.hubCorpus[sig] = true
119 for sig := range hc.hubCorpus {
123 delete(hc.hubCorpus, sig)
126 if hc.needMoreRepros != nil {
128 hc.needMoreRepros <- needReproReply
131 a.Repros = hc.newRepros
137 progDropped := hc.processProgs(r.Progs)
138 reproDropped := hc.processRepros(r.Repros)
139 hc.stats.hubSendProgAdd.add(len(a.Add))
140 hc.stats.hubSendProgDel.add(len(a.Del))
141 hc.stats.hubSendRepro.add(len(a.Repros))
142 hc.stats.hubRecvProg.add(len(r.Progs) - progDropped)
143 hc.stats.hubRecvProgDrop.add(progDropped)
144 hc.stats.hubRecvRepro.add(len(r.Repros) - reproDropped)
145 hc.stats.hubRecvReproDrop.add(reproDropped)
154 hc.newRepros = nil
161 func (hc *HubConnector) processProgs(progs [][]byte) int {
165 if _, err := hc.target.Deserialize(inp); err != nil {
171 hc.mgr.addNewCandidates(candidates)
175 func (hc *HubConnector) processRepros(repros [][]byte) int {
178 if _, err := hc.target.Deserialize(repro); err != nil {
182 hc.hubReproQueue <- &Crash{