MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / SendResp

Method SendResp

internal/nodes/http_writer.go:902–915  ·  view source on GitHub ↗

SendResp 发送响应对象

(resp *http.Response)

Source from the content-addressed store, hash-verified

900
901// SendResp 发送响应对象
902func (this *HTTPWriter) SendResp(resp *http.Response) (int64, error) {
903 this.isFinished = true
904
905 for k, v := range resp.Header {
906 this.SetHeader(k, v)
907 }
908
909 this.WriteHeader(resp.StatusCode)
910 var bufPool = this.req.bytePool(resp.ContentLength)
911 var buf = bufPool.Get()
912 defer bufPool.Put(buf)
913
914 return io.CopyBuffer(this, resp.Body, buf.Bytes)
915}
916
917// Redirect 跳转
918func (this *HTTPWriter) Redirect(status int, url string) {

Callers

nothing calls this directly

Calls 5

SetHeaderMethod · 0.95
WriteHeaderMethod · 0.95
bytePoolMethod · 0.80
GetMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected