]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
* Began working on address book view
[citadel.git] / webcit / webcit.c
index b93114efa15f158bae90d23a6619afc0cc4ac477..97dec65b0e112911829d39a246bae7c8324b0409 100644 (file)
@@ -29,6 +29,7 @@
 #include <pthread.h>
 #include <signal.h>
 #include "webcit.h"
+#include "webserver.h"
 #include "mime_parser.h"
 
 /*
@@ -435,7 +436,7 @@ void output_static(char *what)
 
                fstat(fileno(fp), &statbuf);
                bytes = statbuf.st_size;
-               fprintf(stderr, "Static: %s, %ld bytes\n", what, bytes);
+               lprintf(3, "Static: %s, %ld bytes\n", what, bytes);
                wprintf("Content-length: %ld\n", (long) bytes);
                wprintf("\n");
                bigbuffer = malloc(bytes);
@@ -462,7 +463,7 @@ void output_image()
        off_t thisblock;
        off_t accomplished = 0L;
 
-
+       lprintf(5, "output_image() called\n");
        serv_printf("OIMG %s|%s", bstr("name"), bstr("parm"));
        serv_gets(buf);
        if (buf[0] == '2') {
@@ -682,12 +683,12 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
                        char *encoding, void *userdata)
 {
 
-       fprintf(stderr, "UPLOAD HANDLER CALLED\n");
-       fprintf(stderr, "    name = %s\n", name);
-       fprintf(stderr, "filename = %s\n", filename);
-       fprintf(stderr, "encoding = %s\n", encoding);
-       fprintf(stderr, "    type = %s\n", cbtype);
-       fprintf(stderr, "  length = %ld\n", (long)length);
+       lprintf(5, "UPLOAD HANDLER CALLED\n");
+       lprintf(5, "    name = %s\n", name);
+       lprintf(5, "filename = %s\n", filename);
+       lprintf(5, "encoding = %s\n", encoding);
+       lprintf(5, "    type = %s\n", cbtype);
+       lprintf(5, "  length = %ld\n", (long)length);
 
        if (length > 0) {
                WC->upload = malloc(length);
@@ -696,7 +697,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
                        memcpy(WC->upload, content, length);
                }
                else {
-                       fprintf(stderr, "malloc() failed: %s\n",
+                       lprintf(9, "malloc() failed: %s\n",
                                strerror(errno));
                }
        }
@@ -768,7 +769,7 @@ void session_loop(struct httprequest *req)
        }
 
        if (ContentLength > 0) {
-               fprintf(stderr, "Content length: %d\n", ContentLength);
+               lprintf(5, "Content length: %d\n", ContentLength);
                content = malloc(ContentLength + 1);
                memset(content, 0, ContentLength+1);
                BytesRead = 0;