Lines Matching refs:ContentLength
42 ContentLength int64 // -1 means unknown, 0 means exactly none
56 if rr.ContentLength != 0 && rr.Body == nil {
57 return nil, fmt.Errorf("http: Request.ContentLength=%d with nil Body", rr.ContentLength)
62 t.ContentLength = rr.ContentLength
68 if t.ContentLength == 0 {
73 t.ContentLength = -1
77 // The ContentLength field just wasn't set.
80 t.ContentLength = -1
88 if t.ContentLength < 0 {
99 t.ContentLength = rr.ContentLength
107 // Sanitize Body,ContentLength,TransferEncoding
111 t.ContentLength = -1
118 t.ContentLength = -1
120 t.ContentLength = 0
140 if t.ContentLength > 0 {
143 if t.ContentLength < 0 {
150 if t.ContentLength == 0 && isIdentity(t.TransferEncoding) {
168 // function of the sanitized field triple (Body, ContentLength,
174 if _, err := io.WriteString(w, strconv.FormatInt(t.ContentLength, 10)+"\r\n"); err != nil {
222 } else if t.ContentLength == -1 {
225 ncopy, err = io.Copy(w, io.LimitReader(t.Body, t.ContentLength))
241 if !t.ResponseToHEAD && t.ContentLength != -1 && t.ContentLength != ncopy {
242 return fmt.Errorf("http: ContentLength=%d with Body length %d",
243 t.ContentLength, ncopy)
268 ContentLength int64
353 t.ContentLength = n
356 t.ContentLength = realLength
378 // Prepare body reader. ContentLength < 0 means chunked encoding
406 rr.ContentLength = t.ContentLength
412 rr.ContentLength = t.ContentLength