net/http.transferWriter.ContentLength (field)
20 uses
net/http (current package)
transfer.go#L63: ContentLength int64 // -1 means unknown, 0 means exactly none
transfer.go#L92: t.ContentLength = rr.outgoingLength()
transfer.go#L93: if t.ContentLength < 0 && len(t.TransferEncoding) == 0 && t.shouldSendChunkedRequestBody() {
transfer.go#L103: if t.ContentLength != 0 && !isKnownInMemoryReader(t.Body) {
transfer.go#L115: t.ContentLength = rr.ContentLength
transfer.go#L128: t.ContentLength = -1
transfer.go#L135: t.ContentLength = -1
transfer.go#L137: t.ContentLength = 0
transfer.go#L170: if t.ContentLength >= 0 || t.Body == nil { // redundant checks; caller did them
transfer.go#L222: t.ContentLength = 0
transfer.go#L253: if t.ContentLength > 0 {
transfer.go#L256: if t.ContentLength < 0 {
transfer.go#L263: if t.ContentLength == 0 && isIdentity(t.TransferEncoding) {
transfer.go#L290: if _, err := io.WriteString(w, strconv.FormatInt(t.ContentLength, 10)+"\r\n"); err != nil {
transfer.go#L294: trace.WroteHeaderField("Content-Length", []string{strconv.FormatInt(t.ContentLength, 10)})
transfer.go#L360: } else if t.ContentLength == -1 {
transfer.go#L367: ncopy, err = t.doBodyCopy(w, io.LimitReader(body, t.ContentLength))
transfer.go#L386: if !t.ResponseToHEAD && t.ContentLength != -1 && t.ContentLength != ncopy {
transfer.go#L388: t.ContentLength, ncopy)
 |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |