graphics.o netconf.o siteconfig.o subst.o bbsview_renderer.o \
calendar.o calendar_tools.o calendar_view.o tasks.o event.o smtpqueue.o \
availability.o iconbar.o crypto.o inetconf.o notes.o wiki.o \
- dav_main.o dav_get.o dav_propfind.o fmt_date.o \
+ dav_main.o dav_get.o dav_propfind.o dav_report.o fmt_date.o \
dav_options.o autocompletion.o gettext.o tabs.o sieve.o sitemap.o \
dav_delete.o dav_put.o http_datestring.o setup_wizard.o \
downloads.o addressbook_popup.o pushemail.o sysdep.o openid.o \
graphics.o netconf.o preferences.o html2html.o openid.o bbsview_renderer.o \
summary.o calendar.o calendar_tools.o calendar_view.o tasks.o event.o wiki.o \
availability.o ical_dezonify.o iconbar.o crypto.o inetconf.o notes.o \
- dav_main.o dav_get.o dav_propfind.o dav_delete.o \
+ dav_main.o dav_get.o dav_propfind.o dav_report.o dav_delete.o \
dav_options.o autocompletion.o tabs.o smtpqueue.o sieve.o sitemap.o \
dav_put.o http_datestring.o setup_wizard.o fmt_date.o modules_init.o \
gettext.o downloads.o addressbook_popup.o pushemail.o sysdep.o decode.o \
"DELETE",
"HEAD",
"MOVE",
- "COPY"
+ "COPY",
+ "REPORT"
};
void
v = malloc(sizeof(long));
*v = eCOPY;
Put(HttpReqTypes, HKEY("COPY"), v, NULL);
+
+ v = malloc(sizeof(long));
+ *v = eREPORT;
+ Put(HttpReqTypes, HKEY("REPORT"), v, NULL);
}
void
void dav_delete(void);
void dav_propfind(void);
void dav_options(void);
+void dav_report(void);
long locate_message_by_uid(const char *);
void dav_folder_list(void);
case eDELETE:
dav_delete();
break;
- default:
+ /*
+ * The REPORT method tells us that Mike Shaver is a self-righteous asshole.
+ */
+ case eREPORT:
+ dav_report();
+ break;
+
+ default:
/*
* Couldn't find what we were looking for. Die in a car fire.
*/
/*
* Handles DAV OPTIONS requests (experimental -- not required by GroupDAV)
*
- * Copyright (c) 2005-2010 by the citadel.org team
+ * 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 as published by
syslog(LOG_DEBUG, "\033[36mDAV: 1\033[0m");
}
- hprintf("Allow: OPTIONS, PROPFIND, GET, PUT\r\n");
+ hprintf("Allow: OPTIONS, PROPFIND, GET, PUT, REPORT\r\n");
begin_burst();
end_burst();
}
--- /dev/null
+/*
+ * 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
+
+<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
+ <D:prop>
+ <D:getetag/>
+ </D:prop>
+ <C:filter>
+ <C:comp-filter name="VCALENDAR">
+ <C:comp-filter name="VEVENT">
+ <C:time-range start="20111129T231445Z" end="20120207T231445Z"/>
+ </C:comp-filter>
+ </C:comp-filter>
+ </C:filter>
+</C:calendar-query>
+
+
+REPORT /groupdav/calendar/ HTTP/1.1
+Content-type: application/xml
+Content-length: 255
+
+<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
+ <D:prop>
+ <D:getetag/>
+ </D:prop>
+ <C:filter>
+ <C:comp-filter name="VCALENDAR">
+ <C:comp-filter name="VEVENT"/>
+ </C:comp-filter>
+ </C:filter>
+</C:calendar-query>
+
+*/
+
+#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
+ );
+
+}
char nnn[64];
char buf[SIZ];
int nUsed;
- long len;
NodeConf *Node;
serv_puts("CONF getsys|application/x-citadel-ignet-config");
Hash = NewHash(1, NULL);
Buf = NewStrBuf();
- while (len = StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
+ while (StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
Node = NewNode(Buf);
if (Node != NULL) {
nUsed = GetCount(Hash);
pid_t child = 0;
FILE *fp;
int do_restart = 0;
- int rv;
- FILE *rvfp = NULL;
current_child = 0;
* We don't just call close() because we don't want these fd's
* to be reused for other files.
*/
- rv = chdir("/");
+ chdir("/");
signal(SIGHUP, SIG_IGN);
signal(SIGINT, SIG_IGN);
setsid();
umask(0);
- rvfp = freopen("/dev/null", "r", stdin);
- rvfp = freopen("/dev/null", "w", stdout);
- rvfp = freopen("/dev/null", "w", stderr);
+ freopen("/dev/null", "r", stdin);
+ freopen("/dev/null", "w", stdout);
+ freopen("/dev/null", "w", stderr);
signal(SIGTERM, graceful_shutdown_watcher);
signal(SIGHUP, graceful_shutdown_watcher);
/*
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-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 as published
- * by the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
eHEAD,
eMOVE,
eCOPY,
+ eREPORT,
eNONE
};
extern const char *ReqStrs[eNONE];
const char *basedir = NULL;
char uds_listen_path[PATH_MAX]; /* listen on a unix domain socket? */
const char *I18nDumpFile = NULL;
- int rv = 0;
WildFireInitBacktrace(argv[0], 2);
syslog(1, "***********************************************\n");
return -1;
}
- rv = fwrite(ChrPtr(I18nDump), 1, StrLength(I18nDump), fd);
+ fwrite(ChrPtr(I18nDump), 1, StrLength(I18nDump), fd);
fclose(fd);
return 0;
}