- If a valid Content-Length header field is present without
Transfer-Encoding, its decimal value defines the expected message
body length in octets. If the sender closes the connection or
the recipient times out before the indicated number of octets are
received, the recipient MUST consider the message to be
incomplete and close the connection [RFC 7230 3.3.3]
Because of TCP or read buffer length we might not receive the whole body at once even if they send with content-length option. Then we need a way to decide if we deal with mismatched body size or not (maybe we need to implement some timeout functionality).
Because of TCP or read buffer length we might not receive the whole body at once even if they send with content-length option. Then we need a way to decide if we deal with mismatched body size or not (maybe we need to implement some timeout functionality).