void download_file(void)
{
- StrBuf *Buf;
char buf[256];
off_t bytes;
char content_type[256];
/* Setting to nonzero forces a MIME type of application/octet-stream */
int force_download = 1;
- safestrncpy(buf, ChrPtr(WC->UrlFragment1), sizeof buf);
+ safestrncpy(buf, ChrPtr(WC->UrlFragment2), sizeof buf);
unescape_input(buf);
serv_printf("OPEN %s", buf);
serv_getln(buf, sizeof buf);
extract_token(content_type, &buf[4], 3, '|', sizeof content_type);
}
output_headers(0, 0, 0, 0, 0, 0);
- Buf = read_server_binary(bytes);
+ read_server_binary(WC->WBuf, bytes);
serv_puts("CLOS");
serv_getln(buf, sizeof buf);
- http_transmit_thing(Buf, content_type, 0);
+ http_transmit_thing(content_type, 0);
free(content);
} else {
hprintf("HTTP/1.1 404 %s\n", &buf[4]);