3 * Handles GroupDAV REPORT requests.
5 * Copyright (c) 2005-2012 by the citadel.org team
7 * This program is open source software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version 3.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 /* SAMPLE QUERIES TO WORK WITH *
19 REPORT /groupdav/calendar/ HTTP/1.1
20 Content-type: application/xml
23 <C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
28 <C:comp-filter name="VCALENDAR">
29 <C:comp-filter name="VEVENT">
30 <C:time-range start="20111129T231445Z" end="20120207T231445Z"/>
37 REPORT /groupdav/calendar/ HTTP/1.1
38 Content-type: application/xml
41 <C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
46 <C:comp-filter name="VCALENDAR">
47 <C:comp-filter name="VEVENT"/>
55 #include "webserver.h"
60 * The pathname is always going to be /groupdav/room_name/msg_num
62 void dav_report(void) {
64 time_t now = time(NULL);
66 http_datestring(datestring, sizeof datestring, now);
67 const char *req = ChrPtr(WC->upload);
69 syslog(LOG_DEBUG, "REPORT: \033[31m%s\033[0m", req);
71 hprintf("HTTP/1.1 500 Internal Server Error\r\n");
73 hprintf("Date: %s\r\n", datestring);
74 hprintf("Content-Type: text/plain\r\n");
75 wc_printf("An internal error has occurred at %s:%d.\r\n", __FILE__, __LINE__);
82 extern int ParseMessageListHeaders_EUID(StrBuf * Line,
83 const char **pos, message_summary * Msg, StrBuf * ConversionBuffer, void **ViewSpecific);
85 extern int DavUIDL_GetParamsGetServerCall(SharedMessageStatus * Stat,
86 void **ViewSpecific, long oper, char *cmd, long len, char *filter, long flen);
88 extern int DavUIDL_RenderView_or_Tail(SharedMessageStatus * Stat, void **ViewSpecific, long oper);
90 extern int DavUIDL_Cleanup(void **ViewSpecific);
94 void InitModule_REPORT(void) {
95 RegisterReadLoopHandlerset(eReadEUIDS,
96 DavUIDL_GetParamsGetServerCall,
98 NULL, ParseMessageListHeaders_EUID, NULL, DavUIDL_RenderView_or_Tail, DavUIDL_Cleanup, NULL);