--- evolution-data-server-1.8.3-orig/calendar/backends/caldav/e-cal-backend-caldav.c	2007-01-29 01:44:38.000000000 -0800
+++ evolution-data-server-1.8.3/calendar/backends/caldav/e-cal-backend-caldav.c	2008-05-14 20:32:38.000000000 -0700
@@ -547,23 +547,16 @@
 static guint
 xp_object_get_status (xmlXPathObjectPtr result)
 {
-	gboolean res;
 	guint    ret;
 	
 	
 	if (result == NULL || result->type != XPATH_STRING) {
 		return 0;	
 	}
-	
-	res = soup_headers_parse_status_line ((char *) result->stringval, 
-					      NULL,
-					      &ret,
-					      NULL);
-	
-	if (res != TRUE) {
-		ret = 0;	
-	}
-	
+
+        char *p = strchr((char *)result->stringval, ' ');
+        ret = p ? strtol(p+1, 0, 10) : 0;
+
 	xmlXPathFreeObject (result);
 	return ret;
 }
@@ -671,6 +664,16 @@
 		xpres = xpath_eval (xpctx, XPATH_HREF, i + 1);
 		object->href = xp_object_get_string (xpres);
 
+                /* Make sure that href is an complete, absolute URI */
+                char *strtmp = strstr(object->href, "://");
+                if (strtmp == NULL) {
+                    SoupUri *uritmp = soup_uri_new_with_base (soup_message_get_uri (soup_message), object->href);
+                    strtmp = soup_uri_to_string (uritmp, FALSE);
+                    soup_uri_free (uritmp);
+                    g_free (object->href);
+                    object->href = strtmp;
+                }
+
 		xpres = xpath_eval (xpctx,XPATH_STATUS , i + 1);
 		object->status = xp_object_get_status (xpres);
 
@@ -936,7 +939,7 @@
 
 	hdr = soup_message_get_header (message->response_headers, "Content-Type");
 
-	if (hdr == NULL || g_ascii_strcasecmp (hdr, "text/calendar")) {
+	if (hdr == NULL || !match_header (hdr, "text/calendar")) {
 		result = GNOME_Evolution_Calendar_InvalidObject;
 		g_object_unref (message);
 		g_warning ("Object to fetch not of type text/calendar");
