(e *encoder, l uint32)
| 247 | } |
| 248 | |
| 249 | func (r *repServer) decode(e *encoder, l uint32) { |
| 250 | if l < 4 { |
| 251 | e.check(errors.New("invalid server response")) |
| 252 | } |
| 253 | length := e.uint32() |
| 254 | if length > l-4 { |
| 255 | e.check(errors.New("invalid server response")) |
| 256 | } |
| 257 | b := make([]byte, l-4) |
| 258 | e.read(b) |
| 259 | r.name = string(b[:length]) |
| 260 | r.details = string(b[length:]) |
| 261 | } |
| 262 | |
| 263 | const ( |
| 264 | cInfoExport = 0 |