]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar.c
* read static/server files directly into the outbuffer
[citadel.git] / webcit / calendar.c
index 32a3e02f535b7644ab83e7b771abd615edbc6cac..7b6374eed97bf88d5b4a44a76633221868042f51 100644 (file)
@@ -1073,8 +1073,8 @@ void save_event(void) {
 void do_freebusy(char *req) {
        char who[SIZ];
        char buf[SIZ];
-       char *fb;
        int len;
+       long lines;
 
        extract_token(who, req, 1, ' ', sizeof who);
        if (!strncasecmp(who, "/freebusy/", 10)) {
@@ -1094,17 +1094,16 @@ void do_freebusy(char *req) {
        serv_getln(buf, sizeof buf);
 
        if (buf[0] != '1') {
-               wprintf("HTTP/1.1 404 %s\n", &buf[4]);
+               hprintf("HTTP/1.1 404 %s\n", &buf[4]);
                output_headers(0, 0, 0, 0, 0, 0);
-               wprintf("Content-Type: text/plain\r\n");
-               wprintf("\r\n");
+               hprintf("Content-Type: text/plain\r\n");
                wprintf("%s\n", &buf[4]);
+               end_burst();
                return;
        }
 
-       fb = read_server_text();
-       http_transmit_thing(fb, strlen(fb), "text/calendar", 0);
-       free(fb);
+       read_server_text(WC->WBuf, &lines);
+       http_transmit_thing("text/calendar", 0);
 }