X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fdav_report.c;fp=webcit%2Fdav_report.c;h=33d1683421281b8d339ce4c9d7ed21f934587968;hb=efccdcf4db04e63bfa3512c80215357ee9ffd98f;hp=0000000000000000000000000000000000000000;hpb=7c75121fc25fe20a03fdb05a4d6bfbea3d92f07a;p=citadel.git
diff --git a/webcit/dav_report.c b/webcit/dav_report.c
new file mode 100644
index 000000000..33d168342
--- /dev/null
+++ b/webcit/dav_report.c
@@ -0,0 +1,116 @@
+/*
+ * Handles GroupDAV REPORT requests.
+ *
+ * Copyright (c) 2005-2012 by the citadel.org team
+ *
+ * This program is open source software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+
+/* SAMPLE QUERIES TO WORK WITH *
+
+REPORT /groupdav/calendar/ HTTP/1.1
+Content-type: application/xml
+Content-length: 349
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+REPORT /groupdav/calendar/ HTTP/1.1
+Content-type: application/xml
+Content-length: 255
+
+
+
+
+
+
+
+
+
+
+
+
+*/
+
+#include "webcit.h"
+#include "webserver.h"
+#include "dav.h"
+
+
+/*
+ * The pathname is always going to be /groupdav/room_name/msg_num
+ */
+void dav_report(void)
+{
+ char datestring[256];
+ time_t now = time(NULL);
+
+ http_datestring(datestring, sizeof datestring, now);
+ const char *req = ChrPtr(WC->upload);
+
+ syslog(LOG_DEBUG, "REPORT: \033[31m%s\033[0m", req);
+
+ hprintf("HTTP/1.1 500 Internal Server Error\r\n");
+ dav_common_headers();
+ hprintf("Date: %s\r\n", datestring);
+ hprintf("Content-Type: text/plain\r\n");
+ wc_printf("An internal error has occurred at %s:%d.\r\n", __FILE__ , __LINE__ );
+ end_burst();
+ return;
+}
+
+
+
+extern int ParseMessageListHeaders_EUID(StrBuf *Line,
+ const char **pos,
+ message_summary *Msg,
+ StrBuf *ConversionBuffer);
+
+extern int DavUIDL_GetParamsGetServerCall(SharedMessageStatus *Stat,
+ void **ViewSpecific,
+ long oper,
+ char *cmd,
+ long len);
+
+extern int DavUIDL_RenderView_or_Tail(SharedMessageStatus *Stat,
+ void **ViewSpecific,
+ long oper);
+
+extern int DavUIDL_Cleanup(void **ViewSpecific);
+
+
+
+void
+InitModule_REPORT
+(void)
+{
+ RegisterReadLoopHandlerset(
+ eReadEUIDS,
+ DavUIDL_GetParamsGetServerCall,
+ NULL,
+ ParseMessageListHeaders_EUID,
+ NULL,
+ DavUIDL_RenderView_or_Tail,
+ DavUIDL_Cleanup
+ );
+
+}