(code ResponseCode, msg string)
| 299 | } |
| 300 | |
| 301 | func (h *chReqHandler) WriteErrorChunk(code ResponseCode, msg string) error { |
| 302 | if len(msg) > MaxErrSize { |
| 303 | msg = msg[:MaxErrSize-3] |
| 304 | msg += "..." |
| 305 | } |
| 306 | b := []byte(msg) |
| 307 | return StreamChunk(code, uint64(len(b)), bytes.NewReader(b), h.w, h.comp) |
| 308 | } |
| 309 | |
| 310 | type OnRequestListener func(ctx context.Context, peerId peer.ID, handler ChunkedRequestHandler) |
| 311 |
nothing calls this directly
no test coverage detected