X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fdav_put.c;h=1dcfe66b3b462e0f1eea34330c968cad10959e17;hb=fb6f6fa4ec4e3277e30d84326d48e6850822d318;hp=4052f58e2dc9d9225a7cf32cd5d22796f66e60d1;hpb=977a00909d0de9ab3f96e6f5bdac18d91e30d79f;p=citadel.git diff --git a/webcit/dav_put.c b/webcit/dav_put.c index 4052f58e2..1dcfe66b3 100644 --- a/webcit/dav_put.c +++ b/webcit/dav_put.c @@ -1,21 +1,15 @@ /* * Handles GroupDAV PUT requests. * - * 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 - * 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 "webcit.h" @@ -28,7 +22,7 @@ * component. This would be for webcal:// 'publish' operations, not * for GroupDAV. */ -void groupdav_put_bigics(void) +void dav_put_bigics(void) { wcsession *WCC = WC; char buf[1024]; @@ -44,7 +38,7 @@ void groupdav_put_bigics(void) serv_getln(buf, sizeof buf); if (buf[0] != '4') { hprintf("HTTP/1.1 502 Bad Gateway\r\n"); - groupdav_common_headers(); + dav_common_headers(); hprintf("Content-type: text/plain\r\n"); begin_burst(); wc_printf("%s\r\n", &buf[4]); @@ -58,7 +52,7 @@ void groupdav_put_bigics(void) /* Report success and not much else. */ hprintf("HTTP/1.1 204 No Content\r\n"); syslog(9, "HTTP/1.1 204 No Content\r\n"); - groupdav_common_headers(); + dav_common_headers(); begin_burst(); end_burst(); } @@ -70,7 +64,7 @@ void groupdav_put_bigics(void) * [/groupdav/]room_name/euid (GroupDAV) * [/groupdav/]room_name (webcal) */ -void groupdav_put(void) +void dav_put(void) { wcsession *WCC = WC; StrBuf *dav_roomname; @@ -82,7 +76,7 @@ void groupdav_put(void) if (StrBufNum_tokens(WCC->Hdr->HR.ReqLine, '/') < 2) { hprintf("HTTP/1.1 404 not found\r\n"); - groupdav_common_headers(); + dav_common_headers(); hprintf("Content-Type: text/plain\r\n"); begin_burst(); wc_printf("The object you requested was not found.\r\n"); @@ -105,7 +99,7 @@ void groupdav_put(void) } if (strcasecmp(ChrPtr(WC->CurRoom.name), ChrPtr(dav_roomname))) { hprintf("HTTP/1.1 404 not found\r\n"); - groupdav_common_headers(); + dav_common_headers(); hprintf("Content-Type: text/plain\r\n"); begin_burst(); wc_printf("There is no folder called \"%s\" on this server.\r\n", @@ -131,7 +125,7 @@ void groupdav_put(void) hprintf("HTTP/1.1 412 Precondition Failed\r\n"); syslog(9, "HTTP/1.1 412 Precondition Failed (ifmatch=%ld, old_msgnum=%ld)\r\n", StrTol(WCC->Hdr->HR.dav_ifmatch), old_msgnum); - groupdav_common_headers(); + dav_common_headers(); end_burst(); FreeStrBuf(&dav_roomname); @@ -143,7 +137,7 @@ void groupdav_put(void) /** PUT on the collection itself uploads an ICS of the entire collection. */ if (StrLength(dav_uid) == 0) { - groupdav_put_bigics(); + dav_put_bigics(); FreeStrBuf(&dav_roomname); FreeStrBuf(&dav_uid); return; @@ -158,7 +152,7 @@ void groupdav_put(void) serv_getln(buf, sizeof buf); if (buf[0] != '8') { hprintf("HTTP/1.1 502 Bad Gateway\r\n"); - groupdav_common_headers(); + dav_common_headers(); hprintf("Content-type: text/plain\r\n"); begin_burst(); wc_printf("%s\r\n", &buf[4]); @@ -195,7 +189,7 @@ void groupdav_put(void) /* Citadel failed in some way? */ if (new_msgnum < 0L) { hprintf("HTTP/1.1 502 Bad Gateway\r\n"); - groupdav_common_headers(); + dav_common_headers(); hprintf("Content-type: text/plain\r\n"); begin_burst(); wc_printf("new_msgnum is %ld\r\n" @@ -211,10 +205,10 @@ void groupdav_put(void) char escaped_uid[1024]; hprintf("HTTP/1.1 201 Created\r\n"); syslog(9, "HTTP/1.1 201 Created\r\n"); - groupdav_common_headers(); + dav_common_headers(); hprintf("etag: \"%ld\"\r\n", new_msgnum); hprintf("Location: "); - groupdav_identify_hosthdr(); + dav_identify_hosthdr(); hprintf("/groupdav/");/* TODO */ hurlescputs(ChrPtr(dav_roomname)); euid_escapize(escaped_uid, ChrPtr(dav_uid)); @@ -228,7 +222,7 @@ void groupdav_put(void) /* We modified an existing item. */ hprintf("HTTP/1.1 204 No Content\r\n"); syslog(9, "HTTP/1.1 204 No Content\r\n"); - groupdav_common_headers(); + dav_common_headers(); hprintf("Etag: \"%ld\"\r\n", new_msgnum); /* The item we replaced has probably already been deleted by * the Citadel server, but we'll do this anyway, just in case.