indent -kr -i8 -brf -bbb -fnc -l132 -nce on all of webcit-classic
[citadel.git] / webcit / dav_options.c
index b918730014434798ab65b225b89f40fcd0ce1bc8..8e8e85865cdfcf8d4829137203f21838e11663cf 100644 (file)
@@ -1,21 +1,16 @@
+
 /*
  * 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
- * 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"
@@ -25,8 +20,7 @@
 /*
  * The pathname is always going to be /groupdav/room_name/msg_num
  */
-void dav_options(void)
-{
+void dav_options(void) {
        wcsession *WCC = WC;
        StrBuf *dav_roomname;
        StrBuf *dav_uid;
@@ -71,13 +65,10 @@ void dav_options(void)
                hprintf("HTTP/1.1 404 not found\r\n");
                dav_common_headers();
                hprintf("Date: %s\r\n", datestring);
-               hprintf(
-                       "Content-Type: text/plain\r\n");
+               hprintf("Content-Type: text/plain\r\n");
                begin_burst();
-               wc_printf(
-                       "There is no folder called \"%s\" on this server.\r\n",
-                       ChrPtr(dav_roomname)
-               );
+               wc_printf("There is no folder called \"%s\" on this server.\r\n", ChrPtr(dav_roomname)
+                   );
                end_burst();
                FreeStrBuf(&dav_roomname);
                FreeStrBuf(&dav_uid);
@@ -95,14 +86,12 @@ void dav_options(void)
                        dav_common_headers();
                        hprintf("Content-Type: text/plain\r\n");
                        begin_burst();
-                       wc_printf(
-                               "Object \"%s\" was not found in the \"%s\" folder.\r\n",
-                               ChrPtr(dav_uid),
-                               ChrPtr(dav_roomname)
-                       );
+                       wc_printf("Object \"%s\" was not found in the \"%s\" folder.\r\n", ChrPtr(dav_uid), ChrPtr(dav_roomname)
+                           );
                        FreeStrBuf(&dav_roomname);
                        FreeStrBuf(&dav_uid);
-                       end_burst();return;
+                       end_burst();
+                       return;
                }
 
                hprintf("HTTP/1.1 200 OK\r\n");
@@ -110,7 +99,7 @@ void dav_options(void)
                hprintf("Date: %s\r\n", datestring);
                hprintf("DAV: 1\r\n");
                hprintf("Allow: OPTIONS, PROPFIND, GET, PUT, DELETE\r\n");
-               
+
                begin_burst();
                end_burst();
                FreeStrBuf(&dav_roomname);
@@ -126,9 +115,8 @@ void dav_options(void)
         * an OPTIONS on the room itself.
         */
        syslog(LOG_DEBUG, "\033[36mOPTIONS requested for room '%s' (%slogged in)\033[0m",
-               ChrPtr(WC->CurRoom.name),
-               ((WC->logged_in) ? "" : "not ")
-       );
+              ChrPtr(WC->CurRoom.name), ((WC->logged_in) ? "" : "not ")
+           );
        hprintf("HTTP/1.1 200 OK\r\n");
        dav_common_headers();
        hprintf("Date: %s\r\n", datestring);
@@ -136,7 +124,7 @@ void dav_options(void)
        /*
         * Offer CalDAV (RFC 4791) if this is a calendar room
         */
-       if ( (WC->CurRoom.view == VIEW_CALENDAR) || (WC->CurRoom.view == VIEW_CALBRIEF) ) {
+       if ((WC->CurRoom.view == VIEW_CALENDAR) || (WC->CurRoom.view == VIEW_CALBRIEF)) {
                hprintf("DAV: 1, calendar-access\r\n");
                syslog(LOG_DEBUG, "\033[36mDAV: 1, calendar-access\033[0m");
        }
@@ -145,7 +133,7 @@ void dav_options(void)
                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();
 }