Socket으로 HTTP정보를 받아서, 헤더부분만 잘라서 헤더를 얻으려 합니다.
p = strtok(response, "\r\n\r\n"); 이런식으로 \r\n\r\n 을 기준으로 헤더하고 내용을 분류하려고 하는데, 문제는,
단순히 \r\n으로 되어있는 부분까지 strtok함수가 NULL로 치환하더군요.
\r\n\r\n 으로 된 부분만 NULL로 치환하고 싶은데 어떻게 하면 좋을까요?
strstr(3), memmem(3)
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html Korean Ver: http://cinsk.github.io/cfaqs/
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
strstr(3), memmem(3)
strstr(3), memmem(3)
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Korean Ver: http://cinsk.github.io/cfaqs/
댓글 달기