Re: [evolution-patches] Fix for bug#267402 [HTTPS Calendar Support]



Hi Chenthill,

On Fri, 2006-01-13 at 02:11 -0500, Evolution (bugzilla.gnome.org) wrote:
[snip]
> 
> ------- Comment #7 from chenthill  2006-01-13 07:11 UTC -------
> Please add the Changlog of the changes made. I don't think any copy right
> assignement would be needed fot this since this is not a major enhancement.
> 
> 

Attached is the EDS patch with a ChangeLog entry. The previous patch for
Evolution had a ChangeLog entry.

Cheers,
Tony
--- evolution-data-server-1.5.3/calendar/ChangeLog-	2006-01-15 08:40:52.000000000 +1100
+++ evolution-data-server-1.5.3/calendar/ChangeLog	2006-01-15 08:43:22.000000000 +1100
@@ -1,3 +1,10 @@
+2006-01-05  Tony Tsui <tsui tony gmail com>
+
+	Fixes #267402
+	* backends/http/e-cal-backend-http.c: (webcal_to_http_method,
+	retrieval_done, begin_retrieval_cb): Add support for webcal access
+	via https.
+
 2005-12-11  Tor Lillqvist  <tml novell com>
 
 	* libecal/e-cal.c (set_local_attachment_store,
--- evolution-data-server-1.5.3/calendar/backends/http/e-cal-backend-http.c-	2005-12-31 08:35:43.000000000 +1100
+++ evolution-data-server-1.5.3/calendar/backends/http/e-cal-backend-http.c	2005-12-31 08:49:09.000000000 +1100
@@ -189,12 +189,18 @@ e_cal_backend_http_get_static_capabiliti
 }
 
 static gchar *
-webcal_to_http_method (const gchar *webcal_str)
+webcal_to_http_method (const gchar *webcal_str, gboolean secure)
 {
+	if (secure && (strncmp ("http://";, webcal_str, sizeof ("http://";) - 1) == 0))
+		return g_strconcat ("https://";, webcal_str + sizeof ("http://";) - 1, NULL);
+
 	if (strncmp ("webcal://", webcal_str, sizeof ("webcal://") - 1))
 		return g_strdup (webcal_str);
 
-	return g_strconcat ("http://";, webcal_str + sizeof ("webcal://") - 1, NULL);
+	if (secure)
+		return g_strconcat ("https://";, webcal_str + sizeof ("webcal://") - 1, NULL);
+	else
+		return g_strconcat ("http://";, webcal_str + sizeof ("webcal://") - 1, NULL);
 }
 
 static gboolean
@@ -240,7 +246,7 @@ retrieval_done (SoupMessage *msg, ECalBa
 		if (newuri) {
 			g_free (priv->uri);
 
-			priv->uri = webcal_to_http_method (newuri);
+			priv->uri = webcal_to_http_method (newuri, FALSE);
 			begin_retrieval_cb (cbhttp);
 		} else {
 			if (!priv->opened) {
@@ -425,8 +431,13 @@ begin_retrieval_cb (ECalBackendHttp *cbh
 		g_object_unref (conf_client);
 	}
 
-	if (priv->uri == NULL)
-		priv->uri = webcal_to_http_method (e_cal_backend_get_uri (E_CAL_BACKEND (cbhttp)));
+	if (priv->uri == NULL) {
+		ESource *source = e_cal_backend_get_source (E_CAL_BACKEND (cbhttp));
+		const char *secure_prop = e_source_get_property (source, "secure");
+		
+		priv->uri = webcal_to_http_method (e_cal_backend_get_uri (E_CAL_BACKEND (cbhttp)),
+		                                   (secure_prop && g_str_equal(e_source_get_property (source, "secure"), "1")));
+	}
 
 	/* create message to be sent to server */
 	soup_message = soup_message_new (SOUP_METHOD_GET, priv->uri);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]