4 * Output an HTML message, modifying it slightly to make sure it plays nice
5 * with the rest of our web framework.
15 #include <sys/types.h>
17 #include <sys/socket.h>
19 #include <netinet/in.h>
32 * Here we go. Please note that the buffer may be changed by this function!
34 void output_text_html(char *partbuf, int total_length) {
42 msgend = &partbuf[total_length];
44 while (ptr < msgend) {
46 /* Advance to next tag */
47 ptr = strchr(ptr, '<');
50 /* Any of these tags cause everything up to and including
51 * the tag to be removed.
53 if ( (!strncasecmp(ptr, "HTML", 4))
54 ||(!strncasecmp(ptr, "HEAD", 4))
55 ||(!strncasecmp(ptr, "/HEAD", 5))
56 ||(!strncasecmp(ptr, "BODY", 4)) ) {
57 ptr = strchr(ptr, '>');
62 /* Any of these tags cause everything including and following
63 * the tag to be removed.
65 if ( (!strncasecmp(ptr, "/HTML", 5))
66 ||(!strncasecmp(ptr, "/BODY", 5)) ) {
76 write(WC->http_sock, msgstart, strlen(msgstart));