httpdate(httpnow, time(NULL));
if (do_httpheaders) {
- wprintf("Content-type: text/html\n"
+ wprintf("Content-type: text/html\r\n"
"Server: %s / %s\n", SERVER, serv_info.serv_software
);
if (!cache)
- wprintf("Connection: close\n"
- "Pragma: no-cache\n"
- "Cache-Control: no-store\n"
+ wprintf("Connection: close\r\n"
+ "Pragma: no-cache\r\n"
+ "Cache-Control: no-store\r\n"
);
}
WC->wc_password, WC->wc_roomname);
if (unset_cookies) {
- wprintf("Set-cookie: webcit=%s; path=/\n", unset);
+ wprintf("Set-cookie: webcit=%s; path=/\r\n", unset);
} else {
- wprintf("Set-cookie: webcit=%s; path=/\n", cookie);
+ wprintf("Set-cookie: webcit=%s; path=/\r\n", cookie);
if (server_cookie != NULL) {
wprintf("%s\n", server_cookie);
}
*/
void http_redirect(char *whichpage) {
wprintf("HTTP/1.0 302 Moved Temporarily\n");
- wprintf("Location: %s\n", whichpage);
- wprintf("URI: %s\n", whichpage);
- wprintf("Content-type: text/html\n\n");
+ wprintf("Location: %s\r\n", whichpage);
+ wprintf("URI: %s\r\n", whichpage);
+ wprintf("Content-type: text/html\r\n\r\n");
wprintf("<html><body>\n");
wprintf("you really want to be <A HREF=\"%s\">here</A> now\n",
whichpage);
{
char buf[SIZ];
- lprintf(9, "Checking for instant messages...\n");
serv_puts("NOOP");
serv_gets(buf);
if (buf[3] == '*') WC->HaveInstantMessages = 1;
- lprintf(9, "...done\n");
}
else {
output_headers(0, 0, 0, 0, 0, 0, 0);
}
- wprintf("Content-type: %s\n"
- "Content-length: %ld\n"
- "Server: %s\n"
- "Connection: close\n"
- "\n",
+ wprintf("Content-type: %s\r\n"
+ "Content-length: %ld\r\n"
+ "Server: %s\r\n"
+ "Connection: close\r\n"
+ "\r\n",
content_type,
(long) length,
SERVER
fp = fopen(buf, "rb");
if (fp == NULL) {
wprintf("HTTP/1.0 404 %s\n", strerror(errno));
- wprintf("Content-Type: text/plain\n");
- wprintf("\n");
+ wprintf("Content-Type: text/plain\r\n");
+ wprintf("\r\n");
wprintf("Cannot open %s: %s\n", what, strerror(errno));
} else {
if (!strncasecmp(&what[strlen(what) - 4], ".gif", 4))
fstat(fileno(fp), &statbuf);
bytes = statbuf.st_size;
- /* lprintf(3, "Static: %s, (%s; %ld bytes)\n",
+ /* lprintf(3, "Static: %s, (%s; %ld bytes)\r\n",
what, content_type, bytes); */
bigbuffer = malloc(bytes + 2);
fread(bigbuffer, bytes, 1, fp);
/*
wprintf("HTTP/1.0 404 %s\n", &buf[4]);
output_headers(0, 0, 0, 0, 0, 0, 0);
- wprintf("Content-Type: text/plain\n"
- "\n"
+ wprintf("Content-Type: text/plain\r\n"
+ "\r\n"
"Error retrieving image: %s\n",
&buf[4]
);
} else {
wprintf("HTTP/1.0 404 %s\n", &buf[4]);
output_headers(0, 0, 0, 0, 0, 0, 0);
- wprintf("Content-Type: text/plain\n");
- wprintf("\n");
+ wprintf("Content-Type: text/plain\r\n");
+ wprintf("\r\n");
wprintf("Error retrieving part: %s\n", &buf[4]);
}