Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for unreadDataSizeLocked (0.21 sec)

  1. src/net/http/transfer.go

    	if *dst == nil {
    		*dst = src
    		return
    	}
    	for k, vv := range src {
    		(*dst)[k] = vv
    	}
    }
    
    // unreadDataSizeLocked returns the number of bytes of unread input.
    // It returns -1 if unknown.
    // b.mu must be held.
    func (b *body) unreadDataSizeLocked() int64 {
    	if lr, ok := b.src.(*io.LimitedReader); ok {
    		return lr.N
    	}
    	return -1
    }
    
    func (b *body) Close() error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 22:14:00 UTC 2024
    - 31.1K bytes
    - Viewed (0)
  2. src/net/http/server.go

    		case *body:
    			bdy.mu.Lock()
    			switch {
    			case bdy.closed:
    				if !bdy.sawEOF {
    					// Body was closed in handler with non-EOF error.
    					w.closeAfterReply = true
    				}
    			case bdy.unreadDataSizeLocked() >= maxPostHandlerReadBytes:
    				tooBig = true
    			default:
    				discard = true
    			}
    			bdy.mu.Unlock()
    		default:
    			discard = true
    		}
    
    		if discard {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 123.4K bytes
    - Viewed (0)
Back to top