#include "webserver.h"
#include "groupdav.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
groupdav_common_headers();
hprintf("Date: %s\r\n", datestring);
hprintf("Content-type: text/xml\r\n");
- hprintf("Content-encoding: identity\r\n");
+ if (DisableGzip || (!WCC->Hdr->HR.gzip_ok))
+ hprintf("Content-encoding: identity\r\n");
begin_burst();
*/
void groupdav_propfind(void)
{
+#ifdef DEV_RESTDAV
HashList *SubRooms = NULL;
+ long State;
+#endif
wcsession *WCC = WC;
StrBuf *dav_roomname;
StrBuf *dav_uid;
int i;
char datestring[256];
time_t now;
- long State;
now = time(NULL);
http_datestring(datestring, sizeof datestring, now);
groupdav_common_headers();
hprintf("Date: %s\r\n", datestring);
hprintf("Content-type: text/xml\r\n");
- hprintf("Content-encoding: identity\r\n");
+ if (DisableGzip || (!WCC->Hdr->HR.gzip_ok))
+ hprintf("Content-encoding: identity\r\n");
begin_burst();
groupdav_common_headers();
hprintf("Date: %s\r\n", datestring);
hprintf("Content-type: text/xml\r\n");
- hprintf("Content-encoding: identity\r\n");
+ if (DisableGzip || (!WCC->Hdr->HR.gzip_ok))
+ hprintf("Content-encoding: identity\r\n");
begin_burst();
groupdav_common_headers();
hprintf("Date: %s\r\n", datestring);
hprintf("Content-type: text/xml\r\n");
- hprintf("Content-encoding: identity\r\n");
+ if (DisableGzip || (!WCC->Hdr->HR.gzip_ok))
+ hprintf("Content-encoding: identity\r\n");
begin_burst();
StrBuf_ServGetln(MsgNum);
if (GetServerStatus(MsgNum, NULL) == 1)
- while (BufLen = StrBuf_ServGetln(MsgNum), strcmp(ChrPtr(MsgNum), "000")) {
+ 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);
}
serv_printf("MSG0 %ld|3", msgs[i]);
StrBuf_ServGetln(MsgNum);
if (GetServerStatus(MsgNum, NULL) == 1)
- while (BufLen = StrBuf_ServGetln(MsgNum), strcmp(ChrPtr(MsgNum), "000"))
+ while (BufLen = StrBuf_ServGetln(MsgNum),
+ ((BufLen >= 0) &&
+ ((BufLen != 3) || strcmp(ChrPtr(MsgNum), "000")) ))
{
if (!strncasecmp(ChrPtr(MsgNum), "exti=", 5)) {
strcpy(uid, &ChrPtr(MsgNum)[5]);