http - Split CRLF between TCP payloads -
I am currently writing a low level HTTP parser and running the following problem:
I Receiving HTTP data on a packet-by-packet basis, i.e., TCP pallodes at one time. While parsing this data, I am using HTTP protocol protocols to illustrate header lines, chunk data (in the case of chunked-encoding) for CRLF, and to duplicate the header from the body to the double CRF I am using.
My question is, do I need to worry about the possibility of splitting between two TCP packet payloads of CRLF? For example, the HTTP header will end with CRLFCRLF whether it is possible that the two subsequent TCP packets will have a CR, and then LFCLLF
I agree that yes; This is a matter of concern, because application (HTP) and TCP layers are no different from each other.
Any information in this will be highly appreciated, thanks! Yes, it is possible that the CRLF is divided into different TCP packets. Just think about this possibility that a single HTTP header is exactly one byte from TCP MTU. In that case, there is only one place for CR, but not for NL.
So no one can say how hard your code will be, it should be capable of handling this type of split.
Comments
Post a Comment