httpbeyondheaders.c (642B)
1 #include "crossroads.h" 2 3 unsigned char const *http_beyondheaders (unsigned char const *buf, 4 int buflen) { 5 unsigned char const *cp; 6 7 msg ("Getting beyond-headers block (%d bytes) from '%s'", 8 buflen, buf); 9 for (cp = (unsigned char const *) strchr ( (char const *) buf, '\n'); 10 cp && *cp; 11 cp = (unsigned char const *) strchr ( (char const *) cp, '\n')) { 12 cp++; 13 if (*cp == '\r') 14 cp++; 15 if (*cp == '\n') { 16 cp++; 17 if (cp - buf < buflen) { 18 msg ("Beyond headers block at '%s'", cp); 19 return (cp); 20 } 21 else { 22 msg ("No beyond-headers block present"); 23 return (0); 24 } 25 } 26 } 27 28 return (0); 29 }