From: Wilfried Goesgens Date: Thu, 5 Jan 2012 20:41:37 +0000 (+0100) Subject: Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel X-Git-Tag: v8.11~268 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=20f386fa836709f3165102c34e113668ab73094a;hp=09d85563ff6be31ab572d10fc230cc4f04e7138f Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel --- diff --git a/citadel/server_main.c b/citadel/server_main.c index d1b2a4cd3..592ea7708 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -1,21 +1,15 @@ /* * citserver's main() function lives here. * - * 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. + * 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" @@ -208,7 +202,7 @@ int main(int argc, char **argv) syslog(LOG_NOTICE, "*** Citadel server engine v%d.%02d (build %s) ***", (REV_LEVEL/100), (REV_LEVEL%100), svn_revision()); - syslog(LOG_NOTICE, "Copyright (C) 1987-2011 by the Citadel development team."); + syslog(LOG_NOTICE, "Copyright (C) 1987-2012 by the Citadel development team."); syslog(LOG_NOTICE, "This program is distributed under the terms of the GNU " "General Public License."); syslog(LOG_NOTICE, " "); diff --git a/libcitadel/README.txt b/libcitadel/README.txt index 167df4b76..b24cb9048 100644 --- a/libcitadel/README.txt +++ b/libcitadel/README.txt @@ -4,7 +4,7 @@ WebCit. It is not intended to be a general-purpose library for widespread use, although there are parts of it that may be useful for that purpose, such as the MIME parser and the vCard data type. -Copyright (c) 1987-2011 by the citadel.org development team. +Copyright (c) 1987-2012 by the citadel.org development team. This program is distributed under the terms of the GNU General Public License, version 3. diff --git a/webcit/COPYING b/webcit/COPYING index cdfcbc804..0c6e2104e 100644 --- a/webcit/COPYING +++ b/webcit/COPYING @@ -1,4 +1,4 @@ -Webcit Core is Copyright by the Citadel Development Team 1998 - 2011 +Webcit Core is Copyright by the Citadel Development Team 1998 - 2012 Webcit contains components under different Licenses, here their authors and list: Scriptaculous:Copyright (c) 2005-2007 diff --git a/webcit/README.txt b/webcit/README.txt index 95653514d..aa8f6061f 100644 --- a/webcit/README.txt +++ b/webcit/README.txt @@ -1,6 +1,6 @@ WEBCIT for the Citadel System - Copyright (C) 1996-2011 by the authors. Portions written by: + Copyright (C) 1996-2012 by the authors. Portions written by: Art Cancro Wilfried Goesgens diff --git a/webcit/dav_propfind.c b/webcit/dav_propfind.c index ebf145291..80efafca4 100644 --- a/webcit/dav_propfind.c +++ b/webcit/dav_propfind.c @@ -1,5 +1,5 @@ /* - * Handles GroupDAV PROPFIND requests. + * Handles GroupDAV and CalDAV PROPFIND requests. * * A few notes about our XML output: * @@ -10,7 +10,27 @@ * This makes it difficult to read, but we have discovered clients which * crash when you try to pretty it up. * - * Copyright (c) 2005-2011 by the citadel.org team + * References: + * http://www.ietf.org/rfc/rfc4791.txt + * http://blogs.nologin.es/rickyepoderi/index.php?/archives/14-Introducing-CalDAV-Part-I.html + +Sample query: + +PROPFIND /groupdav/calendar/ HTTP/1.1 +Content-type: text/xml; charset=utf-8 +Content-length: 166 + + + + + + + + + + + * + * 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. @@ -19,15 +39,12 @@ * 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. - * */ #include "webcit.h" #include "webserver.h" #include "dav.h" -extern int DisableGzip; - /* * Given an encoded UID, translate that to an unencoded Citadel EUID and * then search for it in the current room. Return a message number or -1 @@ -428,11 +445,11 @@ void dav_collection_list(void) void propfind_xml_start(void *data, const char *supplied_el, const char **attr) { - syslog(LOG_DEBUG, "<%s>", supplied_el); + // syslog(LOG_DEBUG, "<%s>", supplied_el); } void propfind_xml_end(void *data, const char *supplied_el) { - syslog(LOG_DEBUG, "", supplied_el); + // syslog(LOG_DEBUG, "", supplied_el); } @@ -500,6 +517,10 @@ void dav_propfind(void) StrBufExtract_token(dav_roomname, WCC->Hdr->HR.ReqLine, 0, '/'); StrBufExtract_token(dav_uid, WCC->Hdr->HR.ReqLine, 1, '/'); + syslog(LOG_DEBUG, "PROPFIND requested for '%s' at depth %d", + ChrPtr(dav_roomname), WCC->Hdr->HR.dav_depth + ); + /* * If the room name is blank, the client is requesting a folder list. */ @@ -595,13 +616,16 @@ void dav_propfind(void) /* - * We got to this point, which means that the client is requesting - * a 'collection' (i.e. a list of all items in the room). + * If we get to this point the client is performing a PROPFIND on the room itself. + * + * We call it a room; DAV calls it a "collection." We have to give it some properties + * of the room itself and then offer a list of all items contained therein. * * Be rude. Completely ignore the XML request and simply send them * everything we know about (which is going to simply be the ETag and * nothing else). Let the client-side parser sort it out. */ + //syslog(LOG_DEBUG, "BE RUDE AND IGNORE: \033[31m%s\033[0m", ChrPtr(WC->upload) ); hprintf("HTTP/1.0 207 Multi-Status\r\n"); dav_common_headers(); hprintf("Date: %s\r\n", datestring); @@ -612,36 +636,36 @@ void dav_propfind(void) begin_burst(); wc_printf("" - "" ); - /* Transmit the collection resource (FIXME check depth and starting point) */ - wc_printf(""); + /* Transmit the collection resource */ + wc_printf(""); - wc_printf(""); + wc_printf(""); dav_identify_host(); wc_printf("/groupdav/"); urlescputs(ChrPtr(WCC->CurRoom.name)); - wc_printf(""); + wc_printf(""); - wc_printf(""); - wc_printf("HTTP/1.1 200 OK"); - wc_printf(""); - wc_printf(""); + wc_printf(""); + wc_printf("HTTP/1.1 200 OK"); + wc_printf(""); + wc_printf(""); escputs(ChrPtr(WCC->CurRoom.name)); - wc_printf(""); + wc_printf(""); - wc_printf(""); /* empty owner ought to be legal; see rfc3744 section 5.1 */ + wc_printf(""); /* empty owner ought to be legal; see rfc3744 section 5.1 */ - wc_printf(""); + wc_printf(""); switch(WCC->CurRoom.defview) { case VIEW_CALENDAR: wc_printf(""); - wc_printf(""); + wc_printf(""); break; case VIEW_TASKS: wc_printf(""); @@ -650,90 +674,92 @@ void dav_propfind(void) wc_printf(""); break; } - wc_printf(""); + wc_printf(""); /* FIXME get the mtime - wc_printf(""); + wc_printf(""); escputs(datestring); - wc_printf(""); + wc_printf(""); */ - wc_printf(""); - wc_printf(""); - wc_printf(""); - - /* Transmit the collection listing (FIXME check depth and starting point) */ - - MsgNum = NewStrBuf(); - serv_puts("MSGS ALL"); - - StrBuf_ServGetln(MsgNum); - if (GetServerStatus(MsgNum, NULL) == 1) - while (BufLen = StrBuf_ServGetln(MsgNum), - ((BufLen >= 0) && - ((BufLen != 3) || strcmp(ChrPtr(MsgNum), "000")) )) - { - msgs = realloc(msgs, ++num_msgs * sizeof(long)); - msgs[num_msgs-1] = StrTol(MsgNum); - } + wc_printf(""); + wc_printf(""); + wc_printf(""); - if (num_msgs > 0) for (i=0; iHdr->HR.dav_depth > 0) { + MsgNum = NewStrBuf(); + serv_puts("MSGS ALL"); + StrBuf_ServGetln(MsgNum); if (GetServerStatus(MsgNum, NULL) == 1) while (BufLen = StrBuf_ServGetln(MsgNum), - ((BufLen >= 0) && - ((BufLen != 3) || strcmp(ChrPtr(MsgNum), "000")) )) + ((BufLen >= 0) && + ((BufLen != 3) || strcmp(ChrPtr(MsgNum), "000")) )) { - if (!strncasecmp(ChrPtr(MsgNum), "exti=", 5)) { - strcpy(uid, &ChrPtr(MsgNum)[5]); - } - else if (!strncasecmp(ChrPtr(MsgNum), "time=", 5)) { - now = atol(&ChrPtr(MsgNum)[5]); + msgs = realloc(msgs, ++num_msgs * sizeof(long)); + msgs[num_msgs-1] = StrTol(MsgNum); } - } - - if (!IsEmptyStr(uid)) { - wc_printf(""); - wc_printf(""); - dav_identify_host(); - wc_printf("/groupdav/"); - urlescputs(ChrPtr(WCC->CurRoom.name)); - euid_escapize(encoded_uid, uid); - wc_printf("/%s", encoded_uid); - wc_printf(""); - switch(WCC->CurRoom.defview) { - case VIEW_CALENDAR: - wc_printf("text/x-ical"); - break; - case VIEW_TASKS: - wc_printf("text/x-ical"); - break; - case VIEW_ADDRESSBOOK: - wc_printf("text/x-vcard"); - break; + + if (num_msgs > 0) for (i=0; i= 0) && + ((BufLen != 3) || strcmp(ChrPtr(MsgNum), "000")) )) + { + if (!strncasecmp(ChrPtr(MsgNum), "exti=", 5)) { + strcpy(uid, &ChrPtr(MsgNum)[5]); + } + else if (!strncasecmp(ChrPtr(MsgNum), "time=", 5)) { + now = atol(&ChrPtr(MsgNum)[5]); } - wc_printf(""); - wc_printf("HTTP/1.1 200 OK"); - wc_printf(""); - wc_printf("\"%ld\"", msgs[i]); - if (now > 0L) { - http_datestring(datestring, sizeof datestring, now); - wc_printf(""); - escputs(datestring); - wc_printf(""); + } + + if (!IsEmptyStr(uid)) { + wc_printf(""); + wc_printf(""); + dav_identify_host(); + wc_printf("/groupdav/"); + urlescputs(ChrPtr(WCC->CurRoom.name)); + euid_escapize(encoded_uid, uid); + wc_printf("/%s", encoded_uid); + wc_printf(""); + switch(WCC->CurRoom.defview) { + case VIEW_CALENDAR: + wc_printf("text/x-ical"); + break; + case VIEW_TASKS: + wc_printf("text/x-ical"); + break; + case VIEW_ADDRESSBOOK: + wc_printf("text/x-vcard"); + break; } - wc_printf(""); - wc_printf(""); - wc_printf(""); + wc_printf(""); + wc_printf("HTTP/1.1 200 OK"); + wc_printf(""); + wc_printf("\"%ld\"", msgs[i]); + if (now > 0L) { + http_datestring(datestring, sizeof datestring, now); + wc_printf(""); + escputs(datestring); + wc_printf(""); + } + wc_printf(""); + wc_printf(""); + wc_printf(""); + } } + FreeStrBuf(&MsgNum); } - FreeStrBuf(&MsgNum); - wc_printf("\n"); + wc_printf("\n"); end_burst(); if (msgs != NULL) { diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 7db07943d..735899dbe 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -25,7 +25,6 @@ #include "webcit.h" #include "webserver.h" -extern int DisableGzip; long MaxRead = -1; /* should we do READ scattered or all at once? */ /* diff --git a/webcit/webcit.h b/webcit/webcit.h index e80489f22..5f6cd89b5 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -799,6 +799,7 @@ void http_datestring(char *buf, size_t n, time_t xtime); #define WC_TIMEFORMAT_24 2 extern int time_to_die; /* Nonzero if server is shutting down */ +extern int DisableGzip; /* * Array type for a blog post. The first message is the post; the rest are comments diff --git a/webcit/webserver.c b/webcit/webserver.c index e82148837..803fe4c72 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -1,19 +1,13 @@ /* - * Copyright (c) 1996-2011 by the citadel.org team + * Copyright (c) 1996-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 "webcit.h" @@ -236,7 +230,7 @@ int main(int argc, char **argv) /* Tell 'em who's in da house */ syslog(1, "%s", PACKAGE_STRING); - syslog(1, "Copyright (C) 1996-2011 by the citadel.org team"); + syslog(1, "Copyright (C) 1996-2012 by the citadel.org team"); syslog(1, " "); syslog(1, "This program is open source software: you can redistribute it and/or"); syslog(1, "modify it under the terms of the GNU General Public License as published");