how do i detect \r\n in a u_char type of buffer?

Posted by aDi Adam on Stack Overflow See other posts from Stack Overflow or by aDi Adam
Published on 2013-06-25T04:16:36Z Indexed on 2013/06/25 4:21 UTC
Read the original article Hit count: 117

Filed under:
|

i am trying to construct http content from packet sniffing in C. right now i am able to save all the packets in a file but i want to get rid of the headers in the first packet. they are also being saved as per they are a part of tcp payload. the actual body after the header starts after double "crlf" or \r\n\r\n in http response. how do i detect \r\n so that i can only save the following part of the buffer in the file. the buffer is u_char type. i cant figure out the command or the part i looked on google and other places but i mostly find c# commands, nothing in C.

© Stack Overflow or respective owner

Related posts about c

    Related posts about http