MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / sendChunk

Method sendChunk

pkg/waveapp/streamingresp.go:64–75  ·  view source on GitHub ↗

sendChunk sends a single chunk of exactly maxChunkSize (or less)

(data []byte)

Source from the content-addressed store, hash-verified

62
63// sendChunk sends a single chunk of exactly maxChunkSize (or less)
64func (w *StreamingResponseWriter) sendChunk(data []byte) {
65 if len(data) == 0 {
66 return
67 }
68 chunk := make([]byte, len(data))
69 copy(chunk, data)
70 w.respChan <- wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse]{
71 Response: wshrpc.VDomUrlRequestResponse{
72 Body: chunk,
73 },
74 }
75}
76
77func (w *StreamingResponseWriter) Write(data []byte) (int, error) {
78 if !w.headerSent {

Callers 2

WriteMethod · 0.95
CloseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected