From 2d688af648224bc86faa2ba368647a1407d1aa02 Mon Sep 17 00:00:00 2001 From: Vivek Jain Date: Thu, 17 Feb 2005 09:52:01 +0000 Subject: use ssl when "always" and "whenever possible" is enabled changed 2005-02-17 Vivek Jain * share-folder-common.c : (get_cnc): use ssl when "always" and "whenever possible" is enabled changed "soap_ssl" to "use_ssl" use the default port "7191" instead of "7181" svn path=/trunk/; revision=28806 --- plugins/shared-folder/ChangeLog | 8 ++++++++ plugins/shared-folder/share-folder-common.c | 18 +++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'plugins/shared-folder') diff --git a/plugins/shared-folder/ChangeLog b/plugins/shared-folder/ChangeLog index 9a1eddfdab..833f871ba2 100644 --- a/plugins/shared-folder/ChangeLog +++ b/plugins/shared-folder/ChangeLog @@ -1,3 +1,11 @@ +2005-02-17 Vivek Jain + + * share-folder-common.c : (get_cnc): + + use ssl when "always" and "whenever possible" is enabled + changed "soap_ssl" to "use_ssl" + use the default port "7191" instead of "7181" + 2005-01-24 Vivek Jain *properties.glade : changed the layout of the widgets *share-folder.[ch]: removed the checkbuttons for display of rights diff --git a/plugins/shared-folder/share-folder-common.c b/plugins/shared-folder/share-folder-common.c index 3a107ac2b3..45996caae6 100644 --- a/plugins/shared-folder/share-folder-common.c +++ b/plugins/shared-folder/share-folder-common.c @@ -410,7 +410,8 @@ EGwConnection * get_cnc (CamelStore *store) { EGwConnection *cnc; - const char *uri, *property_value, *use_ssl, *server_name, *user, *port; + const char *uri, *property_value, *server_name, *user, *port; + char *use_ssl; CamelService *service; CamelURL *url; @@ -422,20 +423,27 @@ get_cnc (CamelStore *store) server_name = g_strdup (url->host); user = g_strdup (url->user); property_value = camel_url_get_param (url, "soap_port"); - use_ssl = g_strdup (camel_url_get_param (url, "soap_ssl")); + use_ssl = g_strdup (camel_url_get_param (url, "use_ssl")); if(property_value == NULL) - port = g_strdup ("7181"); + port = g_strdup ("7191"); else if (strlen(property_value) == 0) - port = g_strdup ("7181"); + port = g_strdup ("7191"); else port = g_strdup (property_value); - if (use_ssl) + if (use_ssl && !g_str_equal (use_ssl, "never")) uri = g_strconcat ("https://", server_name, ":", port, "/soap", NULL); else uri = g_strconcat ("http://", server_name, ":", port, "/soap", NULL); cnc = e_gw_connection_new (uri, user, service->url->passwd); + if (!E_IS_GW_CONNECTION(cnc) && use_ssl && g_str_equal (use_ssl, "when-possible")) { + char *http_uri = g_strconcat ("http://", uri + 8, NULL); + cnc = e_gw_connection_new (http_uri, user, service->url->passwd); + g_free (http_uri); + } + g_free (use_ssl); + use_ssl = NULL; return cnc; -- cgit v1.2.3