Fixes for GroupDAV and hprintf
authorMatt <matt@uncensored.citadel.org>
Fri, 8 Aug 2008 10:33:36 +0000 (10:33 +0000)
committerMatt <matt@uncensored.citadel.org>
Fri, 8 Aug 2008 10:33:36 +0000 (10:33 +0000)
- groupdav_common_headers now hprintf
- new function: hurlescputs (hprintf'ed urlescputs)

webcit/groupdav_main.c
webcit/groupdav_put.c
webcit/webcit.c
webcit/webcit.h

index 07fb67d3c7ddbf07d6940716badf88df07ab9673..b03650b77ed07e7092526ff4612dee6e390fb357 100644 (file)
@@ -244,7 +244,7 @@ void groupdav_main(struct httprequest *req,
  */  
 void groupdav_identify_host(void) {
        if (!IsEmptyStr(WC->http_host)) {
-               wprintf("%s://%s",
+               hprintf("%s://%s",
                        (is_https ? "https" : "http"),
                        WC->http_host);
        }
index dc5121f47c4069ad812db89a77ed1cc9b18975fc..b69114c2fb71a253ade4678b905485a6e43cce07 100644 (file)
@@ -180,14 +180,14 @@ void groupdav_put(char *dav_pathname, char *dav_ifmatch,
                lprintf(9, "HTTP/1.1 201 Created\r\n");
                groupdav_common_headers();
                hprintf("etag: \"%ld\"\r\n", new_msgnum);
-               hprintf("Content-Length: 0\r\n");
                hprintf("Location: ");
                groupdav_identify_host();
                hprintf("/groupdav/");/////TODO
-               urlescputs(dav_roomname);
+               hurlescputs(dav_roomname);
                char escaped_uid[1024];
                euid_escapize(escaped_uid, dav_uid);
-               wprintf("/%s\r\n", escaped_uid);
+               hprintf("/%s\r\n", escaped_uid);
+               end_burst();
                return;
        }
 
index f0fd0a269b9a785454d9c1d781f0751ddc39c47d..f510e27bbd37301bc18243c7ccbf75bf0fe2be43 100644 (file)
@@ -513,6 +513,15 @@ void urlescputs(char *strbuf)
        urlesc(outbuf, SIZ, strbuf);
        wprintf("%s", outbuf);
 }
+/**
+ * urlescape buffer and print it as header 
+ */
+void hurlescputs(char *strbuf) {
+       char outbuf[SIZ];
+       
+       urlesc(outbuf, SIZ, strbuf);
+       hprintf("%s", outbuf);
+}
 
 
 /*
index e28ce3bef616f8cfb1520a35b1663f552e390234..7ca5e3ff09eb40b914e996c64d51ec71335d0d4e 100644 (file)
@@ -538,6 +538,7 @@ const char *BSTR(char *key);
 const char *Bstr(char *key, size_t keylen);
 
 void urlescputs(char *);
+void hurlescputs(char *);
 void jsesc(char *, size_t, char *);
 void jsescputs(char *);
 void output_headers(    int do_httpheaders,