()
| 68 | } |
| 69 | |
| 70 | func (e *ulReqEncoder) encodeAdditionalWants() stateFn { |
| 71 | last := e.data.Wants[0] |
| 72 | for _, w := range e.data.Wants[1:] { |
| 73 | if bytes.Equal(last[:], w[:]) { |
| 74 | continue |
| 75 | } |
| 76 | |
| 77 | if err := e.pe.Encodef("want %s\n", w); err != nil { |
| 78 | e.err = fmt.Errorf("encoding want %q: %s", w, err) |
| 79 | return nil |
| 80 | } |
| 81 | |
| 82 | last = w |
| 83 | } |
| 84 | |
| 85 | return e.encodeShallows |
| 86 | } |
| 87 | |
| 88 | func (e *ulReqEncoder) encodeShallows() stateFn { |
| 89 | plumbing.HashesSort(e.data.Shallows) |