OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/evolution-data-server?expand=0&rev=33
This commit is contained in:
parent
076e773739
commit
9d569eed6f
@ -1,12 +1,12 @@
|
||||
Index: camel/providers/groupwise/camel-groupwise-folder.c
|
||||
===================================================================
|
||||
--- camel/providers/groupwise/camel-groupwise-folder.c 2008/05/19 10:25:42 8808
|
||||
+++ camel/providers/groupwise/camel-groupwise-folder.c 2008/05/19 10:33:21 8809
|
||||
@@ -1351,7 +1351,7 @@
|
||||
--- camel/providers/groupwise/camel-groupwise-folder.c.orig
|
||||
+++ camel/providers/groupwise/camel-groupwise-folder.c
|
||||
@@ -1351,7 +1351,7 @@ gw_update_cache (CamelFolder *folder, GL
|
||||
str = g_string_append (str, " ");
|
||||
}
|
||||
|
||||
- if (org->display_name[0] == '\0') {
|
||||
- if (org->display_name[0] == '\0') {
|
||||
+ if (org->display_name && org->display_name[0] == '\0') {
|
||||
|
||||
str = g_string_append (str, org->email);
|
||||
|
@ -1,20 +0,0 @@
|
||||
Index: camel/providers/groupwise/camel-groupwise-folder.c
|
||||
===================================================================
|
||||
--- camel/providers/groupwise/camel-groupwise-folder.c 2008/05/19 10:15:17 8806
|
||||
+++ camel/providers/groupwise/camel-groupwise-folder.c 2008/05/19 10:16:56 8807
|
||||
@@ -201,6 +201,7 @@
|
||||
|
||||
camel_message_info_free (&mi->info);
|
||||
g_free (container_id);
|
||||
+ g_object_unref (item);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -1449,6 +1450,7 @@
|
||||
}
|
||||
/******************** Caching stuff ends *************************/
|
||||
i++;
|
||||
+ g_object_unref (item);
|
||||
}
|
||||
camel_operation_end (NULL);
|
||||
g_free (container_id);
|
@ -1,15 +0,0 @@
|
||||
Index: camel/providers/groupwise/camel-groupwise-folder.c
|
||||
===================================================================
|
||||
--- camel/providers/groupwise/camel-groupwise-folder.c 2008/05/19 11:11:53 8810
|
||||
+++ camel/providers/groupwise/camel-groupwise-folder.c 2008/05/19 11:14:19 8811
|
||||
@@ -2163,8 +2163,8 @@
|
||||
_("This message is not available in offline mode."));
|
||||
|
||||
} else {
|
||||
- camel_folder_summary_remove_uid (source->summary, uids->pdata[index]);
|
||||
- camel_folder_change_info_remove_uid (changes, uids->pdata[index]);
|
||||
+ camel_folder_summary_remove_uid (source->summary, uids->pdata[i]);
|
||||
+ camel_folder_change_info_remove_uid (changes, uids->pdata[i]);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
Index: servers/groupwise/e-gw-container.c
|
||||
===================================================================
|
||||
--- servers/groupwise/e-gw-container.c (revision 8769)
|
||||
+++ servers/groupwise/e-gw-container.c (working copy)
|
||||
@@ -59,10 +59,9 @@ static void
|
||||
free_node(EShUsers *user)
|
||||
{
|
||||
if(user){
|
||||
- g_free(user->email);
|
||||
+ g_free (user->email);
|
||||
g_free (user);
|
||||
}
|
||||
- g_free (user);
|
||||
return ;
|
||||
}
|
||||
|
@ -1,80 +0,0 @@
|
||||
Index: servers/groupwise/soup-soap-response.c
|
||||
===================================================================
|
||||
--- servers/groupwise/soup-soap-response.c (revision 8790)
|
||||
+++ servers/groupwise/soup-soap-response.c (working copy)
|
||||
@@ -562,3 +562,19 @@ soup_xml_real_node (xmlNode *node)
|
||||
node = node->next;
|
||||
return node;
|
||||
}
|
||||
+
|
||||
+
|
||||
+int
|
||||
+soup_soap_response_dump_response (SoupSoapResponse *response, FILE *buffer)
|
||||
+{
|
||||
+ xmlChar *xmlbuff;
|
||||
+ int buffersize, ret;
|
||||
+
|
||||
+ SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
|
||||
+ xmlDocDumpFormatMemory(priv->xmldoc, &xmlbuff, &buffersize, 1);
|
||||
+
|
||||
+ ret = fputs ((char *) xmlbuff, buffer);
|
||||
+ xmlFree (xmlbuff);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
Index: servers/groupwise/soup-soap-response.h
|
||||
===================================================================
|
||||
--- servers/groupwise/soup-soap-response.h (revision 8790)
|
||||
+++ servers/groupwise/soup-soap-response.h (working copy)
|
||||
@@ -61,6 +61,9 @@ SoupSoapParameter *soup_soap_response_ge
|
||||
SoupSoapParameter *from,
|
||||
const char *name);
|
||||
|
||||
+int soup_soap_response_dump_response (SoupSoapResponse *response, FILE *buffer);
|
||||
+
|
||||
+
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
||||
Index: servers/groupwise/e-gw-connection.c
|
||||
===================================================================
|
||||
--- servers/groupwise/e-gw-connection.c (revision 8790)
|
||||
+++ servers/groupwise/e-gw-connection.c (working copy)
|
||||
@@ -444,16 +444,18 @@ e_gw_connection_init (EGwConnection *cnc
|
||||
priv->book_list = NULL;
|
||||
priv->opts = NULL;
|
||||
|
||||
- if (g_getenv ("GROUPWISE_DEBUG")) {
|
||||
+ /* README: We do not use libsoup logger and use our own as we need formatted output etc. */
|
||||
+ /*
|
||||
+ if (g_getenv ("GROUPWISE_DEBUG")) {
|
||||
if (atoi (g_getenv ("GROUPWISE_DEBUG")) == 1) {
|
||||
SoupLogger *logger;
|
||||
|
||||
- logger = soup_logger_new (SOUP_LOGGER_LOG_BODY,
|
||||
- SOUP_LOGGER_LOG_BODY);
|
||||
+ logger = soup_logger_new (SOUP_LOGGER_LOG_BODY, -1);
|
||||
soup_logger_attach (logger, priv->soup_session);
|
||||
g_object_unref (logger);
|
||||
}
|
||||
}
|
||||
+ */
|
||||
}
|
||||
|
||||
GType
|
||||
@@ -675,6 +677,15 @@ e_gw_connection_send_message (EGwConnect
|
||||
|
||||
/* process response */
|
||||
response = soup_soap_message_parse_response (msg);
|
||||
+
|
||||
+ if (g_getenv ("GROUPWISE_DEBUG")) {
|
||||
+
|
||||
+ /* README: The stdout can be replaced with Evolution's
|
||||
+ Logging framework also */
|
||||
+
|
||||
+ soup_soap_response_dump_response (response, stdout);
|
||||
+ g_print ("\n------\n");
|
||||
+ }
|
||||
|
||||
return response;
|
||||
}
|
@ -1,997 +0,0 @@
|
||||
Index: servers/exchange/lib/e2k-context.c
|
||||
===================================================================
|
||||
--- servers/exchange/lib/e2k-context.c (revision 8580)
|
||||
+++ servers/exchange/lib/e2k-context.c (revision 8581)
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "e2k-utils.h"
|
||||
#include "e2k-xml-utils.h"
|
||||
|
||||
+#include <libedataserver/e-proxy.h>
|
||||
#include <libsoup/soup.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/tree.h>
|
||||
@@ -98,6 +99,7 @@
|
||||
/* Forms-based authentication */
|
||||
char *cookie;
|
||||
gboolean cookie_verified;
|
||||
+ EProxy* proxy;
|
||||
};
|
||||
|
||||
/* For operations with progress */
|
||||
@@ -107,6 +109,9 @@
|
||||
/* For soup sync session timeout */
|
||||
#define E2K_SOUP_SESSION_TIMEOUT 30
|
||||
|
||||
+/* Soup session proxy-uri property */
|
||||
+#define SOUP_SESSION_PROXY_URI "proxy-uri"
|
||||
+
|
||||
#ifdef E2K_DEBUG
|
||||
char *e2k_debug;
|
||||
int e2k_debug_level;
|
||||
@@ -124,8 +129,33 @@
|
||||
static gboolean do_notification (GIOChannel *source, GIOCondition condition, gpointer data);
|
||||
|
||||
static void setup_message (SoupSession *session, SoupMessage *msg, SoupSocket *socket, gpointer user_data);
|
||||
+static void proxy_settings_changed (EProxy *proxy, gpointer user_data);
|
||||
|
||||
+
|
||||
static void
|
||||
+proxy_settings_changed (EProxy *proxy, gpointer user_data)
|
||||
+{
|
||||
+ SoupURI *proxy_uri = NULL;
|
||||
+ E2kContext* ctx = (E2kContext *)user_data;
|
||||
+ if (!ctx || !ctx->priv ||
|
||||
+ (!ctx->priv->session && !ctx->priv->async_session) ||
|
||||
+ (!ctx->priv->owa_uri))
|
||||
+ return;
|
||||
+
|
||||
+ if (!e_proxy_require_proxy_for_uri (proxy, ctx->priv->owa_uri))
|
||||
+ proxy_uri = NULL;
|
||||
+ else
|
||||
+ proxy_uri = e_proxy_peek_uri (proxy);
|
||||
+
|
||||
+ if (ctx->priv->session)
|
||||
+ g_object_set (ctx->priv->session, SOUP_SESSION_PROXY_URI,
|
||||
+ proxy_uri, NULL);
|
||||
+ if (ctx->priv->async_session)
|
||||
+ g_object_set (ctx->priv->async_session, SOUP_SESSION_PROXY_URI,
|
||||
+ proxy_uri, NULL);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
init (GObject *object)
|
||||
{
|
||||
E2kContext *ctx = E2K_CONTEXT (object);
|
||||
@@ -135,6 +165,9 @@
|
||||
g_hash_table_new (g_str_hash, g_str_equal);
|
||||
ctx->priv->subscriptions_by_uri =
|
||||
g_hash_table_new (g_str_hash, g_str_equal);
|
||||
+ ctx->priv->proxy = e_proxy_new ();
|
||||
+ e_proxy_setup_proxy (ctx->priv->proxy);
|
||||
+ g_signal_connect (ctx->priv->proxy, "changed", G_CALLBACK (proxy_settings_changed), ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -182,8 +215,13 @@
|
||||
g_free (ctx->priv->cookie);
|
||||
g_free (ctx->priv->notification_uri);
|
||||
|
||||
+ if (ctx->priv->proxy) {
|
||||
+ g_object_unref (ctx->priv->proxy);
|
||||
+ ctx->priv->proxy = NULL;
|
||||
+ }
|
||||
g_free (ctx->priv);
|
||||
ctx->priv = NULL;
|
||||
+
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
@@ -361,6 +399,7 @@
|
||||
const char *password)
|
||||
{
|
||||
guint timeout = E2K_SOUP_SESSION_TIMEOUT;
|
||||
+ SoupURI* uri = NULL;
|
||||
#ifdef E2K_DEBUG
|
||||
SoupLogger *logger;
|
||||
SoupLoggerLogLevel level;
|
||||
@@ -395,9 +434,14 @@
|
||||
if (g_getenv ("SOUP_SESSION_TIMEOUT"))
|
||||
timeout = atoi (g_getenv ("SOUP_SESSION_TIMEOUT"));
|
||||
|
||||
+ /* Check do we need a proxy to contact the server? */
|
||||
+ if (e_proxy_require_proxy_for_uri (ctx->priv->proxy, ctx->priv->owa_uri))
|
||||
+ uri = e_proxy_peek_uri (ctx->priv->proxy);
|
||||
+
|
||||
ctx->priv->session = soup_session_sync_new_with_options (
|
||||
SOUP_SESSION_USE_NTLM, !authmech || !strcmp (authmech, "NTLM"),
|
||||
SOUP_SESSION_TIMEOUT, timeout,
|
||||
+ SOUP_SESSION_PROXY_URI, uri,
|
||||
NULL);
|
||||
g_signal_connect (ctx->priv->session, "authenticate",
|
||||
G_CALLBACK (session_authenticate), ctx);
|
||||
@@ -406,7 +450,7 @@
|
||||
|
||||
ctx->priv->async_session = soup_session_async_new_with_options (
|
||||
SOUP_SESSION_USE_NTLM, !authmech || !strcmp (authmech, "NTLM"),
|
||||
- NULL);
|
||||
+ SOUP_SESSION_PROXY_URI, uri, NULL);
|
||||
g_signal_connect (ctx->priv->async_session, "authenticate",
|
||||
G_CALLBACK (session_authenticate), ctx);
|
||||
g_signal_connect (ctx->priv->async_session, "request_started",
|
||||
Index: servers/groupwise/Makefile.am
|
||||
===================================================================
|
||||
--- servers/groupwise/Makefile.am (revision 8580)
|
||||
+++ servers/groupwise/Makefile.am (revision 8581)
|
||||
@@ -15,9 +15,10 @@
|
||||
$(E_DATA_SERVER_LIBS)
|
||||
|
||||
soap_test_SOURCES = soap-test.c
|
||||
-soap_test_LDADD = \
|
||||
- $(SOUP_LIBS) \
|
||||
- libegroupwise-1.2.la \
|
||||
+soap_test_LDADD = \
|
||||
+ $(top_builddir)/libedataserver/libedataserver-1.2.la \
|
||||
+ $(SOUP_LIBS) \
|
||||
+ libegroupwise-1.2.la \
|
||||
$(E_DATA_SERVER_LIBS)
|
||||
|
||||
build-timestamp.h : $(top_builddir)/config.h
|
||||
Index: servers/groupwise/e-gw-connection.c
|
||||
===================================================================
|
||||
--- servers/groupwise/e-gw-connection.c (revision 8580)
|
||||
+++ servers/groupwise/e-gw-connection.c (revision 8581)
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
+#include <libedataserver/e-proxy.h>
|
||||
#include <libsoup/soup.h>
|
||||
#include "soup-soap-message.h"
|
||||
#include "e-gw-connection.h"
|
||||
@@ -37,6 +38,9 @@
|
||||
/* For soup sync session timeout */
|
||||
#define GW_SOUP_SESSION_TIMEOUT 30
|
||||
|
||||
+/* Soup session proxy-uri property */
|
||||
+#define SOUP_SESSION_PROXY_URI "proxy-uri"
|
||||
+
|
||||
static GObjectClass *parent_class = NULL;
|
||||
static GHashTable *loaded_connections_permissions = NULL;
|
||||
|
||||
@@ -57,8 +61,37 @@
|
||||
GList *book_list;
|
||||
EGwSendOptions *opts;
|
||||
GMutex *reauth_mutex;
|
||||
+ EProxy *proxy;
|
||||
};
|
||||
|
||||
+static void
|
||||
+update_soup_session_proxy_settings (EProxy *proxy, SoupSession* session,
|
||||
+ const char* uri)
|
||||
+{
|
||||
+ SoupURI *proxy_uri = NULL;
|
||||
+
|
||||
+ if (!session || !uri || !proxy)
|
||||
+ return;
|
||||
+
|
||||
+ if (e_proxy_require_proxy_for_uri (proxy, uri))
|
||||
+ proxy_uri = e_proxy_peek_uri (proxy);
|
||||
+
|
||||
+ g_object_set (session, SOUP_SESSION_PROXY_URI,
|
||||
+ proxy_uri, NULL);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+proxy_settings_changed (EProxy *proxy, gpointer user_data)
|
||||
+{
|
||||
+ EGwConnection* conn = (EGwConnection *)user_data;
|
||||
+ if (!conn || !conn->priv || !conn->priv->soup_session)
|
||||
+ return;
|
||||
+
|
||||
+ update_soup_session_proxy_settings (proxy,
|
||||
+ conn->priv->soup_session,
|
||||
+ conn->priv->uri);
|
||||
+}
|
||||
+
|
||||
static EGwConnectionStatus
|
||||
reauthenticate (EGwConnection *cnc)
|
||||
{
|
||||
@@ -342,6 +375,11 @@
|
||||
g_free (priv->server_time) ;
|
||||
priv->server_time = NULL ;
|
||||
}
|
||||
+
|
||||
+ if (priv->proxy) {
|
||||
+ g_object_unref (priv->proxy);
|
||||
+ priv->proxy = NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (parent_class->dispose)
|
||||
@@ -393,6 +431,11 @@
|
||||
if (g_getenv ("SOUP_SESSION_TIMEOUT"))
|
||||
timeout = atoi (g_getenv ("SOUP_SESSION_TIMEOUT"));
|
||||
|
||||
+ /* Initialize proxy settings */
|
||||
+ priv->proxy = e_proxy_new ();
|
||||
+ e_proxy_setup_proxy (priv->proxy);
|
||||
+ g_signal_connect (priv->proxy, "changed", G_CALLBACK (proxy_settings_changed), cnc);
|
||||
+
|
||||
/* create the SoupSession for this connection */
|
||||
priv->soup_session = soup_session_sync_new_with_options (SOUP_SESSION_TIMEOUT, timeout, NULL);
|
||||
priv->reauth_mutex = g_mutex_new ();
|
||||
@@ -491,6 +534,12 @@
|
||||
/* not found, so create a new connection */
|
||||
cnc = g_object_new (E_TYPE_GW_CONNECTION, NULL);
|
||||
|
||||
+ /* Set proxy details for the Soup session before any
|
||||
+ communication. */
|
||||
+ update_soup_session_proxy_settings (cnc->priv->proxy,
|
||||
+ cnc->priv->soup_session,
|
||||
+ uri);
|
||||
+
|
||||
msg = form_login_request (uri, username, password);
|
||||
|
||||
/* send message to server */
|
||||
Index: libedataserver/e-proxy.c
|
||||
===================================================================
|
||||
--- libedataserver/e-proxy.c (revision 0)
|
||||
+++ libedataserver/e-proxy.c (revision 8581)
|
||||
@@ -0,0 +1,649 @@
|
||||
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
+/*
|
||||
+ * Authors: Jeffrey Stedfast <fejj@ximian.com>
|
||||
+ * Veerapuram Varadhan <vvaradhan@novell.com>
|
||||
+ *
|
||||
+ * Copyright 2002 Ximian, Inc. (www.ximian.com)
|
||||
+ *
|
||||
+ * This program is free 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 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+#include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <netinet/in.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <glib.h>
|
||||
+#include <glib-object.h>
|
||||
+
|
||||
+#include <gconf/gconf.h>
|
||||
+#include <gconf/gconf-client.h>
|
||||
+
|
||||
+#include <libsoup/soup-address.h>
|
||||
+#include <libsoup/soup-uri.h>
|
||||
+#include "e-proxy.h"
|
||||
+
|
||||
+/* Debug */
|
||||
+#define d(x)
|
||||
+
|
||||
+/* GConf paths and keys */
|
||||
+#define PATH_GCONF_NETWORK_CONFIG "/apps/evolution/shell/network_config"
|
||||
+#define KEY_GCONF_HTTP_PROXY_PORT (PATH_GCONF_NETWORK_CONFIG "/" "http_port")
|
||||
+#define KEY_GCONF_HTTP_PROXY_HOST (PATH_GCONF_NETWORK_CONFIG "/" "http_host")
|
||||
+#define KEY_GCONF_HTTPS_PROXY_PORT (PATH_GCONF_NETWORK_CONFIG "/" "secure_port")
|
||||
+#define KEY_GCONF_HTTPS_PROXY_HOST (PATH_GCONF_NETWORK_CONFIG "/" "secure_host")
|
||||
+#define KEY_GCONF_SOCKS_PROXY_PORT (PATH_GCONF_NETWORK_CONFIG "/" "socks_port")
|
||||
+#define KEY_GCONF_SOCKS_PROXY_HOST (PATH_GCONF_NETWORK_CONFIG "/" "socks_host")
|
||||
+#define KEY_GCONF_USE_HTTP_PROXY (PATH_GCONF_NETWORK_CONFIG "/" "use_http_proxy")
|
||||
+#define KEY_GCONF_HTTP_AUTH_USER (PATH_GCONF_NETWORK_CONFIG "/" "authentication_user")
|
||||
+#define KEY_GCONF_HTTP_AUTH_PW (PATH_GCONF_NETWORK_CONFIG "/" "authentication_password")
|
||||
+#define KEY_GCONF_HTTP_USE_AUTH (PATH_GCONF_NETWORK_CONFIG "/" "use_authentication")
|
||||
+
|
||||
+#define KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS (PATH_GCONF_NETWORK_CONFIG "/" "ignore_hosts")
|
||||
+
|
||||
+struct _EProxyPrivate {
|
||||
+ SoupURI* uri;
|
||||
+ guint notify_id; /* conxn id of gconf_client_notify_add */
|
||||
+ GSList* ign_hosts; /* List of hostnames. (Strings) */
|
||||
+ GSList* ign_addrs; /* List of hostaddrs. (ProxyHostAddrs) */
|
||||
+ gboolean use_proxy; /* Is system-proxy enabled? */
|
||||
+};
|
||||
+
|
||||
+/* Enum definition is copied from gnome-vfs/modules/http-proxy.c */
|
||||
+typedef enum {
|
||||
+ PROXY_IPV4 = 4,
|
||||
+ PROXY_IPV6 = 6
|
||||
+} ProxyAddrType;
|
||||
+
|
||||
+typedef struct {
|
||||
+ ProxyAddrType type; /* Specifies whether IPV4 or IPV6 */
|
||||
+ void* addr; /* Either in_addr* or in6_addr* */
|
||||
+ void* mask; /* Either in_addr* or in6_addr* */
|
||||
+} ProxyHostAddr;
|
||||
+
|
||||
+/* Signals. */
|
||||
+enum {
|
||||
+ CHANGED,
|
||||
+ LAST_SIGNAL
|
||||
+};
|
||||
+
|
||||
+static GObjectClass *parent_class;
|
||||
+static unsigned int signals[LAST_SIGNAL] = { 0 };
|
||||
+
|
||||
+/* Forward declarations. */
|
||||
+
|
||||
+static void ep_setting_changed (GConfClient *client, guint32 cnxn_id,
|
||||
+ GConfEntry *entry, gpointer user_data);
|
||||
+static void e_proxy_dispose (GObject* object);
|
||||
+
|
||||
+static void ipv6_network_addr (const struct in6_addr *addr,
|
||||
+ const struct in6_addr *mask,
|
||||
+ struct in6_addr *res);
|
||||
+
|
||||
+static void
|
||||
+ep_free_proxy_host_addr (ProxyHostAddr* host)
|
||||
+{
|
||||
+ if (host) {
|
||||
+ if (host->addr) {
|
||||
+ g_free (host->addr);
|
||||
+ host->addr = NULL;
|
||||
+ }
|
||||
+ if (host->mask) {
|
||||
+ g_free (host->mask);
|
||||
+ host->mask = NULL;
|
||||
+ }
|
||||
+ g_free (host);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void
|
||||
+e_proxy_class_init (EProxyClass *klass)
|
||||
+{
|
||||
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
+
|
||||
+ parent_class = g_type_class_peek_parent (klass);
|
||||
+
|
||||
+ object_class->dispose = e_proxy_dispose;
|
||||
+
|
||||
+ /* signals */
|
||||
+
|
||||
+ /**
|
||||
+ * EProxy::changed:
|
||||
+ * @proxy: the proxy
|
||||
+ *
|
||||
+ * Emitted when proxy settings in gconf changes.
|
||||
+ **/
|
||||
+ signals[CHANGED] =
|
||||
+ g_signal_new ("changed",
|
||||
+ G_OBJECT_CLASS_TYPE (object_class),
|
||||
+ G_SIGNAL_RUN_FIRST,
|
||||
+ G_STRUCT_OFFSET (EProxyClass, changed),
|
||||
+ NULL, NULL,
|
||||
+ g_cclosure_marshal_VOID__VOID,
|
||||
+ G_TYPE_NONE, 0);
|
||||
+
|
||||
+
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+e_proxy_init (EProxy *pxy, EProxyClass *klass)
|
||||
+{
|
||||
+ EProxyPrivate *priv;
|
||||
+
|
||||
+ /* allocate internal structure */
|
||||
+ priv = g_new0 (EProxyPrivate, 1);
|
||||
+ pxy->priv = priv;
|
||||
+ priv->ign_hosts = NULL;
|
||||
+ priv->ign_addrs = NULL;
|
||||
+ priv->uri = NULL;
|
||||
+ priv->notify_id = 0;
|
||||
+ priv->use_proxy = FALSE;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+e_proxy_dispose (GObject *object)
|
||||
+{
|
||||
+ EProxy *proxy = (EProxy *)object;
|
||||
+
|
||||
+ if (!E_IS_PROXY (proxy))
|
||||
+ return;
|
||||
+
|
||||
+ EProxyPrivate *priv = proxy->priv;
|
||||
+
|
||||
+ if (priv) {
|
||||
+ GConfClient* client = NULL;
|
||||
+
|
||||
+ if ((client = gconf_client_get_default ())) {
|
||||
+ if (priv->notify_id > 0)
|
||||
+ gconf_client_notify_remove (client, priv->notify_id);
|
||||
+ g_object_unref (client);
|
||||
+ }
|
||||
+
|
||||
+ if (priv->uri)
|
||||
+ soup_uri_free (priv->uri);
|
||||
+
|
||||
+ if (priv->ign_hosts) {
|
||||
+ g_slist_foreach (priv->ign_hosts, (GFunc) ep_free_proxy_host_addr, NULL);
|
||||
+ g_slist_free (priv->ign_hosts);
|
||||
+ }
|
||||
+
|
||||
+ if (priv->ign_addrs) {
|
||||
+ g_slist_foreach (priv->ign_addrs, (GFunc) g_free, NULL);
|
||||
+ g_slist_free (priv->ign_addrs);
|
||||
+ }
|
||||
+
|
||||
+ priv->notify_id = 0;
|
||||
+
|
||||
+ g_free (priv);
|
||||
+ priv = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+GType
|
||||
+e_proxy_get_type (void)
|
||||
+{
|
||||
+ static GType type = 0;
|
||||
+
|
||||
+ if (!type) {
|
||||
+ static GTypeInfo info = {
|
||||
+ sizeof (EProxyClass),
|
||||
+ (GBaseInitFunc) NULL,
|
||||
+ (GBaseFinalizeFunc) NULL,
|
||||
+ (GClassInitFunc) e_proxy_class_init,
|
||||
+ NULL, NULL,
|
||||
+ sizeof (EProxy),
|
||||
+ 0,
|
||||
+ (GInstanceInitFunc) e_proxy_init
|
||||
+ };
|
||||
+ type = g_type_register_static (G_TYPE_OBJECT, "EProxy", &info, 0);
|
||||
+ }
|
||||
+
|
||||
+ return type;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+ep_need_proxy (EProxy* proxy, const char* host)
|
||||
+{
|
||||
+ SoupAddress *addr = NULL;
|
||||
+ EProxyPrivate *priv = proxy->priv;
|
||||
+ ProxyHostAddr *p_addr = NULL;
|
||||
+ GSList *l;
|
||||
+ guint status;
|
||||
+
|
||||
+ addr = soup_address_new (host, 0);
|
||||
+ status = soup_address_resolve_sync (addr, NULL);
|
||||
+ if (status == SOUP_STATUS_OK) {
|
||||
+ gint addr_len;
|
||||
+ struct sockaddr* s_addr = NULL;
|
||||
+
|
||||
+ s_addr = soup_address_get_sockaddr (addr, &addr_len);
|
||||
+
|
||||
+ /* This will never happen, since we have already called
|
||||
+ soup_address_resolve_sync().
|
||||
+ */
|
||||
+ if (!s_addr)
|
||||
+ return TRUE;
|
||||
+
|
||||
+ if (s_addr->sa_family == AF_INET) {
|
||||
+ struct in_addr in, *mask, *addr_in;
|
||||
+
|
||||
+ in = ((struct sockaddr_in *)s_addr)->sin_addr;
|
||||
+ for (l = priv->ign_addrs; l; l = l->next) {
|
||||
+ p_addr = (ProxyHostAddr *)l->data;
|
||||
+ if (p_addr->type == PROXY_IPV4) {
|
||||
+ addr_in = ((struct in_addr *)p_addr->addr);
|
||||
+ mask = ((struct in_addr *)p_addr->mask);
|
||||
+ d(g_print ("ep_need_proxy:ipv4: in: %ul\t mask: %ul\t addr: %ul\n",
|
||||
+ in.s_addr, mask->s_addr, addr_in->s_addr));
|
||||
+ if ((in.s_addr & mask->s_addr) == addr_in->s_addr) {
|
||||
+ d(g_print ("Host [%s] doesn't require proxy\n", host));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ struct in6_addr in6, net6;
|
||||
+ struct in_addr *addr_in, *mask;
|
||||
+
|
||||
+ in6 = ((struct sockaddr_in6 *)s_addr)->sin6_addr;
|
||||
+ for (l = priv->ign_addrs; l; l = l->next) {
|
||||
+ p_addr = (ProxyHostAddr *)l->data;
|
||||
+ ipv6_network_addr (&in6, (struct in6_addr *)p_addr->mask, &net6);
|
||||
+ if (p_addr->type == PROXY_IPV6) {
|
||||
+ if (IN6_ARE_ADDR_EQUAL (&net6, (struct in6_addr *)p_addr->addr)) {
|
||||
+ d(g_print ("Host [%s] doesn't require proxy\n", host));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ } else if (p_addr->type == PROXY_IPV6 &&
|
||||
+ IN6_IS_ADDR_V4MAPPED (&net6)) {
|
||||
+ guint32 v4addr;
|
||||
+
|
||||
+ addr_in = ((struct in_addr *)p_addr->addr);
|
||||
+ mask = ((struct in_addr *)p_addr->mask);
|
||||
+
|
||||
+ v4addr = net6.s6_addr[12] << 24
|
||||
+ | net6.s6_addr[13] << 16
|
||||
+ | net6.s6_addr[14] << 8
|
||||
+ | net6.s6_addr[15];
|
||||
+ if ((v4addr & mask->s_addr) != addr_in->s_addr) {
|
||||
+ d(g_print ("Host [%s] doesn't require proxy\n", host));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ GSList* l;
|
||||
+ gchar* hn = g_ascii_strdown (host, -1);
|
||||
+
|
||||
+ for (l = priv->ign_hosts; l; l = l->next) {
|
||||
+ if (*((gchar *)l->data) == '*') {
|
||||
+ if (g_str_has_suffix (hn, ((gchar *)l->data)+1)) {
|
||||
+ g_free (hn);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ } else if (strcmp (hn, l->data) == 0) {
|
||||
+ g_free (hn);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+ g_free (hn);
|
||||
+ }
|
||||
+
|
||||
+ d(g_print ("%s needs a proxy to connect to internet\n", host));
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+ep_manipulate_ipv4 (ProxyHostAddr *host_addr,
|
||||
+ struct in_addr *addr_in,
|
||||
+ gchar* netmask)
|
||||
+{
|
||||
+ gboolean has_error = FALSE;
|
||||
+ struct in_addr *addr, *mask;
|
||||
+
|
||||
+ if (!addr_in)
|
||||
+ return has_error;
|
||||
+
|
||||
+ host_addr->type = PROXY_IPV4;
|
||||
+ addr = g_new0 (struct in_addr, 1);
|
||||
+ memcpy (addr, addr_in, sizeof (struct in_addr));
|
||||
+ mask = g_new0 (struct in_addr, 1);
|
||||
+
|
||||
+ if (netmask) {
|
||||
+ gchar *endptr;
|
||||
+ gint width = strtol (netmask, &endptr, 10);
|
||||
+
|
||||
+ if (*endptr != '\0' || width < 0 || width > 32) {
|
||||
+ has_error = TRUE;
|
||||
+ }
|
||||
+ mask->s_addr = htonl (~0 << width);
|
||||
+ addr->s_addr &= mask->s_addr;
|
||||
+ } else {
|
||||
+ mask->s_addr = 0xFFFFFFFF;
|
||||
+ }
|
||||
+
|
||||
+ d(g_print ("ep_manipulate_ipv4: addr_in: %ul, addr: %ul, mask: %ul\n",
|
||||
+ addr_in->s_addr, addr->s_addr, mask->s_addr));
|
||||
+
|
||||
+ host_addr->addr = addr;
|
||||
+ host_addr->mask = mask;
|
||||
+
|
||||
+ return has_error;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+ipv6_network_addr(const struct in6_addr *addr, const struct in6_addr *mask,
|
||||
+ struct in6_addr *res)
|
||||
+{
|
||||
+ gint i;
|
||||
+
|
||||
+ for (i = 0; i < 16; ++i) {
|
||||
+ res->s6_addr[i] = addr->s6_addr[i] & mask->s6_addr[i];
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+ep_manipulate_ipv6 (ProxyHostAddr *host_addr,
|
||||
+ struct in6_addr *addr_in6,
|
||||
+ gchar* netmask)
|
||||
+{
|
||||
+ gboolean has_error = FALSE;
|
||||
+ struct in6_addr *addr, *mask;
|
||||
+ int i;
|
||||
+
|
||||
+ if (!addr_in6)
|
||||
+ return has_error;
|
||||
+
|
||||
+ host_addr->type = PROXY_IPV6;
|
||||
+
|
||||
+ addr = g_new0 (struct in6_addr, 1);
|
||||
+ mask = g_new0 (struct in6_addr, 1);
|
||||
+
|
||||
+ for (i = 0; i < 16; ++i) {
|
||||
+ addr->s6_addr[i] = addr_in6->s6_addr[i];
|
||||
+ }
|
||||
+ if (netmask) {
|
||||
+ gchar *endptr;
|
||||
+ gint width = strtol(netmask, &endptr, 10);
|
||||
+
|
||||
+ if (*endptr != '\0' || width < 0 || width > 128) {
|
||||
+ has_error = TRUE;
|
||||
+ }
|
||||
+ for (i = 0; i < 16; ++i) {
|
||||
+ mask->s6_addr[i] = 0;
|
||||
+ }
|
||||
+ for (i = 0; i < width / 8; i++) {
|
||||
+ mask->s6_addr[i] = 0xff;
|
||||
+ }
|
||||
+ mask->s6_addr[i] = (0xff << (8 - width % 8)) & 0xff;
|
||||
+ ipv6_network_addr(addr, mask, addr);
|
||||
+ } else {
|
||||
+ for (i = 0; i < 16; ++i) {
|
||||
+ mask->s6_addr[i] = 0xff;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ host_addr->addr = addr;
|
||||
+ host_addr->mask = mask;
|
||||
+
|
||||
+ return has_error;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+ep_parse_ignore_host (gpointer data, gpointer user_data)
|
||||
+{
|
||||
+ EProxy* proxy = (EProxy *)user_data;
|
||||
+ EProxyPrivate* priv = NULL;
|
||||
+ SoupAddress *addr;
|
||||
+ guint status;
|
||||
+ gchar *input, *netmask, *hostname;
|
||||
+ ProxyHostAddr *host_addr;
|
||||
+ gboolean has_error = FALSE;
|
||||
+
|
||||
+ if (!proxy || !proxy->priv)
|
||||
+ return;
|
||||
+
|
||||
+ priv = proxy->priv;
|
||||
+ input = (gchar *)data;
|
||||
+
|
||||
+ if ((netmask = strrchr (input, '/')) != NULL) {
|
||||
+ hostname = g_strndup (input, netmask - input);
|
||||
+ ++netmask;
|
||||
+ } else {
|
||||
+ hostname = g_ascii_strdown (input, -1);
|
||||
+ }
|
||||
+
|
||||
+ addr = soup_address_new (hostname, 0);
|
||||
+ status = soup_address_resolve_sync (addr, NULL);
|
||||
+ if (status == SOUP_STATUS_OK) {
|
||||
+ gint addr_len;
|
||||
+ struct sockaddr* s_addr = NULL;
|
||||
+
|
||||
+ host_addr = g_new0 (ProxyHostAddr, 1);
|
||||
+
|
||||
+ s_addr = soup_address_get_sockaddr (addr, &addr_len);
|
||||
+
|
||||
+ /* This will never happen, since we have already called
|
||||
+ soup_address_resolve_sync().
|
||||
+ */
|
||||
+ if (!s_addr)
|
||||
+ goto error;
|
||||
+
|
||||
+ if (s_addr->sa_family == AF_INET)
|
||||
+ has_error = ep_manipulate_ipv4 (host_addr,
|
||||
+ &((struct sockaddr_in *)s_addr)->sin_addr,
|
||||
+ netmask);
|
||||
+ else
|
||||
+ has_error = ep_manipulate_ipv6 (host_addr,
|
||||
+ &((struct sockaddr_in6 *)s_addr)->sin6_addr,
|
||||
+ netmask);
|
||||
+
|
||||
+ if (!has_error)
|
||||
+ priv->ign_addrs = g_slist_append (priv->ign_addrs, host_addr);
|
||||
+
|
||||
+ g_free (hostname);
|
||||
+ } else {
|
||||
+ d(g_print ("Unable to resolve %s\n", hostname));
|
||||
+ priv->ign_hosts = g_slist_append (priv->ign_hosts, hostname);
|
||||
+ }
|
||||
+ error:
|
||||
+ g_object_unref (addr);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+ep_set_proxy (GConfClient *client,
|
||||
+ gpointer user_data,
|
||||
+ gboolean regen_ign_host_list,
|
||||
+ gboolean set_auth)
|
||||
+{
|
||||
+ char *proxy_server = NULL, *proxy_user = NULL, *proxy_pw = NULL, *uri = NULL;
|
||||
+ gboolean use_auth;
|
||||
+ int proxy_port;
|
||||
+ EProxy* proxy = (EProxy *)user_data;
|
||||
+ EProxyPrivate* priv = proxy->priv;
|
||||
+ GSList *ignore;
|
||||
+
|
||||
+ priv->use_proxy = gconf_client_get_bool (client, KEY_GCONF_USE_HTTP_PROXY, NULL);
|
||||
+ if (priv->use_proxy == FALSE) {
|
||||
+ if (priv->uri) {
|
||||
+ soup_uri_free (priv->uri);
|
||||
+ priv->uri = NULL;
|
||||
+ }
|
||||
+ goto emit_signal;
|
||||
+ }
|
||||
+
|
||||
+ proxy_server = gconf_client_get_string (client, KEY_GCONF_HTTP_PROXY_HOST, NULL);
|
||||
+ proxy_port = gconf_client_get_int (client, KEY_GCONF_HTTP_PROXY_PORT, NULL);
|
||||
+ uri = g_strdup_printf ("http://%s:%d", proxy_server, proxy_port);
|
||||
+ d(g_print ("ep_set_proxy: uri: %s\n", uri));
|
||||
+
|
||||
+ if (regen_ign_host_list) {
|
||||
+ if (priv->ign_hosts) {
|
||||
+ g_slist_foreach (priv->ign_hosts, (GFunc) g_free, NULL);
|
||||
+ g_slist_free (priv->ign_hosts);
|
||||
+ priv->ign_hosts = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (priv->ign_addrs) {
|
||||
+ g_slist_foreach (priv->ign_addrs, (GFunc) g_free, NULL);
|
||||
+ g_slist_free (priv->ign_addrs);
|
||||
+ priv->ign_addrs = NULL;
|
||||
+ }
|
||||
+
|
||||
+ ignore = gconf_client_get_list (client, KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS,
|
||||
+ GCONF_VALUE_STRING, NULL);
|
||||
+ if (ignore) {
|
||||
+ g_slist_foreach (ignore, (GFunc) ep_parse_ignore_host, proxy);
|
||||
+ g_slist_foreach (ignore, (GFunc) g_free, NULL);
|
||||
+ g_slist_free (ignore);
|
||||
+ }
|
||||
+ } else if (set_auth) {
|
||||
+
|
||||
+ use_auth = gconf_client_get_bool (client, KEY_GCONF_HTTP_USE_AUTH, NULL);
|
||||
+ if (use_auth == TRUE) {
|
||||
+ proxy_user = gconf_client_get_string (client, KEY_GCONF_HTTP_AUTH_USER, NULL);
|
||||
+ proxy_pw = gconf_client_get_string (client, KEY_GCONF_HTTP_AUTH_PW, NULL);
|
||||
+
|
||||
+ if (uri)
|
||||
+ g_free (uri);
|
||||
+
|
||||
+ uri = g_strdup_printf ("http://%s:%s@%s:%d", proxy_user, proxy_pw, proxy_server, proxy_port);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (priv->uri) {
|
||||
+ soup_uri_free (priv->uri);
|
||||
+ priv->uri = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (uri)
|
||||
+ priv->uri = soup_uri_new (uri);
|
||||
+ d(g_print ("system-proxy: uri: %s\n", uri));
|
||||
+
|
||||
+ emit_signal:
|
||||
+ g_signal_emit (proxy, signals[CHANGED], 0);
|
||||
+
|
||||
+ g_free (uri);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+ep_setting_changed (GConfClient *client, guint32 cnxn_id,
|
||||
+ GConfEntry *entry, gpointer user_data)
|
||||
+{
|
||||
+ const char *key;
|
||||
+ EProxy* proxy = (EProxy *)user_data;
|
||||
+
|
||||
+ if (!proxy || !proxy->priv)
|
||||
+ return;
|
||||
+
|
||||
+ key = gconf_entry_get_key(entry);
|
||||
+
|
||||
+ if (strcmp(key, KEY_GCONF_USE_HTTP_PROXY) == 0
|
||||
+ || strcmp(key, KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS) == 0
|
||||
+ || strcmp(key, KEY_GCONF_HTTP_PROXY_HOST) == 0
|
||||
+ || strcmp(key, KEY_GCONF_HTTP_PROXY_PORT) == 0) {
|
||||
+ gboolean regen_ign_host_list = FALSE;
|
||||
+
|
||||
+ if (strcmp(key, KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS) == 0)
|
||||
+ regen_ign_host_list = TRUE;
|
||||
+ ep_set_proxy (client, user_data, regen_ign_host_list, FALSE);
|
||||
+ d(g_print ("e-proxy.c:ep_settings_changed: proxy settings changed\n"));
|
||||
+ } else if (strcmp(key, KEY_GCONF_HTTP_AUTH_USER) == 0
|
||||
+ || strcmp(key, KEY_GCONF_HTTP_AUTH_PW) == 0
|
||||
+ || strcmp(key, KEY_GCONF_HTTP_USE_AUTH) == 0) {
|
||||
+ ep_set_proxy (client, user_data, FALSE, TRUE);
|
||||
+ d(g_print ("e-proxy.c:ep_settings_changed: auth settings changed\n"));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+EProxy*
|
||||
+e_proxy_new (void)
|
||||
+{
|
||||
+ EProxy *proxy = NULL;
|
||||
+
|
||||
+ proxy = g_object_new (E_TYPE_PROXY, NULL);
|
||||
+
|
||||
+ return proxy;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+e_proxy_setup_proxy (EProxy* proxy)
|
||||
+{
|
||||
+ GConfClient *client;
|
||||
+
|
||||
+ /* We get the evolution-shell proxy keys here
|
||||
+ set soup up to use the proxy,
|
||||
+ and listen to any changes */
|
||||
+
|
||||
+ if (!(client = gconf_client_get_default ()))
|
||||
+ return;
|
||||
+
|
||||
+ if (!proxy || !proxy->priv)
|
||||
+ return;
|
||||
+
|
||||
+ /* Listen to the changes in the evolution-shell path */
|
||||
+ gconf_client_add_dir (client, PATH_GCONF_NETWORK_CONFIG,
|
||||
+ GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
+
|
||||
+ if (proxy->priv->notify_id == 0)
|
||||
+ proxy->priv->notify_id = gconf_client_notify_add (client, PATH_GCONF_NETWORK_CONFIG,
|
||||
+ ep_setting_changed, (gpointer)proxy,
|
||||
+ NULL, NULL);
|
||||
+
|
||||
+ ep_set_proxy (client, proxy, TRUE, TRUE);
|
||||
+
|
||||
+ g_object_unref (client);
|
||||
+}
|
||||
+
|
||||
+SoupURI*
|
||||
+e_proxy_peek_uri (EProxy* proxy)
|
||||
+{
|
||||
+ if (!proxy || !proxy->priv)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return proxy->priv->uri;
|
||||
+}
|
||||
+
|
||||
+gboolean
|
||||
+e_proxy_require_proxy_for_uri (EProxy* proxy, const char* uri)
|
||||
+{
|
||||
+ SoupURI *srv_uri = NULL;
|
||||
+ gboolean ret = FALSE;
|
||||
+
|
||||
+ if (!uri || !proxy || !proxy->priv)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (!proxy->priv->use_proxy) {
|
||||
+ d(g_print ("[%s] don't need a proxy to connect to internet\n", uri));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ srv_uri = soup_uri_new (uri);
|
||||
+
|
||||
+ ret = ep_need_proxy (proxy, srv_uri->host);
|
||||
+
|
||||
+ soup_uri_free (srv_uri);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
Index: libedataserver/e-proxy.h
|
||||
===================================================================
|
||||
--- libedataserver/e-proxy.h (revision 0)
|
||||
+++ libedataserver/e-proxy.h (revision 8581)
|
||||
@@ -0,0 +1,63 @@
|
||||
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
+/*
|
||||
+ * Authors: Jeffrey Stedfast <fejj@ximian.com>
|
||||
+ * Veerapuram Varadhan <vvaradhan@novell.com>
|
||||
+ *
|
||||
+ * Copyright 2002 Ximian, Inc. (www.ximian.com)
|
||||
+ *
|
||||
+ * This program is free 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 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * 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 Street #330, Boston, MA 02111-1307, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+#ifndef __E_PROXY_H__
|
||||
+#define __E_PROXY_H__
|
||||
+
|
||||
+#include <libsoup/soup-uri.h>
|
||||
+
|
||||
+G_BEGIN_DECLS
|
||||
+
|
||||
+#define E_TYPE_PROXY (e_proxy_get_type ())
|
||||
+#define E_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_PROXY, EProxy))
|
||||
+#define E_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_PROXY, EProxyClass))
|
||||
+#define E_IS_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_PROXY))
|
||||
+#define E_IS_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_PROXY))
|
||||
+
|
||||
+typedef struct _EProxy EProxy;
|
||||
+typedef struct _EProxyClass EProxyClass;
|
||||
+typedef struct _EProxyPrivate EProxyPrivate;
|
||||
+
|
||||
+struct _EProxy {
|
||||
+ GObject parent;
|
||||
+ EProxyPrivate *priv;
|
||||
+};
|
||||
+
|
||||
+struct _EProxyClass {
|
||||
+ GObjectClass parent_class;
|
||||
+ /* Signals. */
|
||||
+
|
||||
+ void (*changed) (EProxy *proxy);
|
||||
+};
|
||||
+
|
||||
+EProxy* e_proxy_new (void);
|
||||
+SoupURI* e_proxy_peek_uri (EProxy* proxy);
|
||||
+void e_proxy_setup_proxy (EProxy* proxy);
|
||||
+GType e_proxy_get_type (void);
|
||||
+gboolean e_proxy_require_proxy_for_uri (EProxy *proxy,
|
||||
+ const char* uri);
|
||||
+
|
||||
+G_END_DECLS
|
||||
+
|
||||
+#endif
|
||||
Index: libedataserver/Makefile.am
|
||||
===================================================================
|
||||
--- libedataserver/Makefile.am (revision 8580)
|
||||
+++ libedataserver/Makefile.am (revision 8581)
|
||||
@@ -7,7 +7,8 @@
|
||||
-DE_DATA_SERVER_EXTENSIONDIR=\"$(extensiondir)\" \
|
||||
-DE_DATA_SERVER_IMAGESDIR=\"$(imagesdir)\" \
|
||||
-DE_DATA_SERVER_UI_GLADEDIR=\""$(gladedir)"\" \
|
||||
- $(E_DATA_SERVER_CFLAGS)
|
||||
+ $(E_DATA_SERVER_CFLAGS) \
|
||||
+ $(SOUP_CFLAGS)
|
||||
|
||||
lib_LTLIBRARIES = libedataserver-1.2.la
|
||||
noinst_PROGRAMS = test-source-list
|
||||
@@ -28,6 +29,7 @@
|
||||
e-list-iterator.c \
|
||||
e-memory.c \
|
||||
e-msgport.c \
|
||||
+ e-proxy.c \
|
||||
e-sexp.c \
|
||||
e-source-group.c \
|
||||
e-source-list.c \
|
||||
@@ -46,7 +48,8 @@
|
||||
$(E_DATA_SERVER_LIBS) \
|
||||
$(ICONV_LIBS) \
|
||||
$(DB_LIBS) \
|
||||
- $(SOCKET_LIBS)
|
||||
+ $(SOCKET_LIBS) \
|
||||
+ $(SOUP_LIBS)
|
||||
|
||||
libedataserver_1_2_la_LDFLAGS = \
|
||||
-version-info $(LIBEDATASERVER_CURRENT):$(LIBEDATASERVER_REVISION):$(LIBEDATASERVER_AGE) $(NO_UNDEFINED)
|
||||
@@ -69,6 +72,7 @@
|
||||
e-list-iterator.h \
|
||||
e-memory.h \
|
||||
e-msgport.h \
|
||||
+ e-proxy.h \
|
||||
e-sexp.h \
|
||||
e-source-group.h \
|
||||
e-source-list.h \
|
@ -1,28 +0,0 @@
|
||||
--- calendar/libecal/e-cal-component.c 2008-05-09 13:12:53.000000000 +0530
|
||||
+++ calendar/libecal/e-cal-component.c 2008-05-09 13:24:49.000000000 +0530
|
||||
@@ -307,8 +307,15 @@ free_icalcomponent (ECalComponent *comp,
|
||||
|
||||
priv->status = NULL;
|
||||
|
||||
- for (l = priv->attachment_list; l != NULL; l = l->next)
|
||||
- g_free (l->data);
|
||||
+ for (l = priv->attachment_list; l != NULL; l = l->next) {
|
||||
+ struct attachment *attachment;
|
||||
+
|
||||
+ attachment = l->data;
|
||||
+
|
||||
+ icalattach_unref (attachment->attach);
|
||||
+ g_free (attachment);
|
||||
+ }
|
||||
+
|
||||
g_slist_free (priv->attachment_list);
|
||||
priv->attachment_list = NULL;
|
||||
|
||||
@@ -532,6 +539,7 @@ scan_attachment (GSList **attachment_lis
|
||||
attachment->prop = prop;
|
||||
|
||||
attachment->attach = icalproperty_get_attach (prop);
|
||||
+ icalattach_ref (attachment->attach);
|
||||
|
||||
*attachment_list = g_slist_append (*attachment_list, attachment);
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
Index: servers/groupwise/e-gw-item.c
|
||||
===================================================================
|
||||
--- servers/groupwise/e-gw-item.c (revision 8803)
|
||||
+++ servers/groupwise/e-gw-item.c (working copy)
|
||||
@@ -543,7 +543,7 @@ e_gw_item_init (EGwItem *item, EGwItemCl
|
||||
priv->attach_list = NULL ;
|
||||
priv->simple_fields = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
|
||||
priv->full_name = g_new0(FullName, 1);
|
||||
- priv->addresses = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_postal_address);
|
||||
+ priv->addresses = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, free_postal_address);
|
||||
priv->additions = g_hash_table_new(g_str_hash, g_str_equal);
|
||||
priv->updates = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
priv->deletions = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
@@ -1277,7 +1277,7 @@ set_contact_fields_from_soap_parameter (
|
||||
add = "Other";
|
||||
|
||||
if (value)
|
||||
- g_hash_table_insert (item->priv->addresses, (char*)add, address);
|
||||
+ g_hash_table_insert (item->priv->addresses, (char *) add, address);
|
||||
else
|
||||
free_postal_address (address);
|
||||
g_free (value);
|
||||
@@ -1411,7 +1411,7 @@ set_organization_fields_from_soap_parame
|
||||
if (subparam) {
|
||||
address = g_new0 (PostalAddress, 1);
|
||||
set_postal_address_from_soap_parameter (address, subparam);
|
||||
- g_hash_table_insert (item->priv->addresses, g_strdup ("Office"), address);
|
||||
+ g_hash_table_insert (item->priv->addresses, "Office", address);
|
||||
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d962cba11605c01bdfdb573032bdda8bca07878026ab3d2dfa5723002d12f8dc
|
||||
size 7612898
|
3
evolution-data-server-2.23.4.tar.bz2
Normal file
3
evolution-data-server-2.23.4.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8f9084a5d2cd9998bea251f843ed13c8d48ff7494fae17ec8f65356c4973bbca
|
||||
size 7650255
|
@ -1,3 +1,42 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 20 20:39:26 CEST 2008 - maw@suse.de
|
||||
|
||||
- Update to version 2.23.4:
|
||||
+ Configurable proxy settings
|
||||
+ Quota support for IMAP
|
||||
+ Google contact API support in libgdata-google
|
||||
+ A lot of IMAP4 improvements
|
||||
+ Use new paths for header files that have been moved to
|
||||
libebackend
|
||||
+ Use "dialog-password" icon instead of "dialog-question" in the
|
||||
password dialog (HIG compliance)
|
||||
+ Bugs fixed: bnc#394654, bgo#304029, bgo#509721, bgo#521921,
|
||||
bgo#527544, bgo#530241, bgo#534080, bgo#534111, bgo#536154,
|
||||
bgo#536636, bgo#318803, bgo#326149, bgo#354923, bgo#374616,
|
||||
bnc#388579, bgo#473658, bgo#518312, bgo#530514, bgo#530543,
|
||||
bgo#530763, bgo#531009, bgo#531439, bgo#531591, bgo#531713,
|
||||
bgo#532286, bgo#533058, bgo#533780, bgo#534077, bgo#534294,
|
||||
bgo#534312, bnc#182380, bgo#274316, bgo#301980, bgo#316390,
|
||||
bgo#325882, bgo#330990, bnc#338330, bgo#347061, bnc#350143,
|
||||
bnc#358584, bnc#358644, bnc#358650, bnc#381307, bnc#382736,
|
||||
bgo#424744, bgo#502899, bgo#517244, bgo#520532, bgo#530139,
|
||||
bgo#530323, bgo#530688, bgo#532284, bgo#235681, bgo#257361,
|
||||
bgo#270406, bgo#271863, bgo#274316, bgo#303067, bgo#341004,
|
||||
bgo#369512, bnc#372383, bgo#417000, bgo#453109, bgo#473880,
|
||||
bgo#475616, bgo#494311, bgo#500389, bgo#514300, bgo#514827,
|
||||
bgo#516608, bgo#518710, bgo#518886, bgo#520526, bgo#521015,
|
||||
bgo#522389, bgo#522433, bgo#523023, bgo#523126, bgo#523528,
|
||||
bgo#523533, bgo#523541, bgo#523630, bgo#518656, bgo#524324,
|
||||
bgo#524704, bgo#525242, bgo#525485, bgo#526138, and bgo#526741
|
||||
+ Updated translations
|
||||
- Drop obsolete patches: bnc-188523-eds-fix-authenticated-proxy-support.diff,
|
||||
bnc-388579-ical-fix-for-exch.patch, bgo-532284-gw-double-free.patch,
|
||||
bgo-533058-gw-debug-logs.patch, bgo-530543-leak-while-syncing-mails-for-offline.diff,
|
||||
bgo-531009-right-iterator-to-prevent-crash-in-offline-mail.diff,
|
||||
and bnc-394654-eds-crasher.patch
|
||||
- Respin following patch:
|
||||
bgo-530514-check-to-handle-specific-server-response.diff.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 2 10:43:43 CEST 2008 - abharath@suse.de
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package evolution-data-server (Version 2.22.1.1)
|
||||
# spec file for package evolution-data-server (Version 2.23.4)
|
||||
#
|
||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
@ -17,34 +17,20 @@ License: GPL v2 or later
|
||||
Group: Development/Libraries/GNOME
|
||||
AutoReqProv: on
|
||||
Summary: Evolution Data Server
|
||||
Version: 2.22.1.1
|
||||
Release: 9
|
||||
Version: 2.23.4
|
||||
Release: 1
|
||||
Source0: ftp://ftp.gnome.org/pub/gnome/sources/evolution-data-server/2.22/%{name}-%{version}.tar.bz2
|
||||
Patch0: evolution-data-server-configure.patch
|
||||
# PATCH-FIX-UPSTREAM bnc-164367-gw-attachments-appts-throw-error.patch bnc164367 -
|
||||
# PATCH-NEEDS-REBASE bnc-164367-gw-attachments-appts-throw-error.patch bnc164367 -- was PATCH-FIX-UPSTREAM, and may be droppable
|
||||
Patch1: bnc-164367-gw-attachments-appts-throw-error.patch
|
||||
# PATCH-FIX-UPSTREAM bnc-188523-eds-fix-authenticated-proxy-support.diff msuman@suse.de --
|
||||
Patch2: bnc-188523-eds-fix-authenticated-proxy-support.diff
|
||||
# PATCH-FIX-UPSTREAM evolution-data-server-1.11.5-cert-auth-complete.patch bgo253574 -- Fix has been submitted to bgo.
|
||||
Patch3: evolution-data-server-1.11.5-cert-auth-complete.patch
|
||||
# PATCH-FIX-UPSTREAM bnc-304835-ex-crash-after-restart.patch bnc304835 bgo253574 -- Fix has been submitted to bgo.
|
||||
Patch4: bnc-304835-ex-crash-after-restart.patch
|
||||
# PATCH-FIX-UPSTREAM: bnc-307861-calendar-auth.diff - bnc307861 bgo253574 -- Fix has been submitted to bgo.
|
||||
Patch5: bnc-307861-calendar-auth.diff
|
||||
# PATCH-FIX-UPSTREAM: bnc-388579-ical-fix-for-exch.patch bnc388579 psankar@suse.de - Fix is in upstream svn from 2.22.2
|
||||
Patch6: bnc-388579-ical-fix-for-exch.patch
|
||||
# PATCH-FIX-UPSTREAM: bgo-532284-gw-double-free.patch bgo532284 psankar@suse.de - Fix is in upstream svn from 2.22.2
|
||||
Patch7: bgo-532284-gw-double-free.patch
|
||||
# PATCH-FIX-UPSTREAM: bgo-533058-gw-debug-logs.patch bgo533058 psankar@suse.de - Fix is in upstream svn from 2.22.2
|
||||
Patch8: bgo-533058-gw-debug-logs.patch
|
||||
# PATCH-FIX-UPSTREAM: bgo-530514-check-to-handle-specific-server-response.diff bgo530514 psankar@suse.de - Fix is in upstream svn from 2.22.2
|
||||
Patch9: bgo-530514-check-to-handle-specific-server-response.diff
|
||||
# PATCH-FIX-UPSTREAM: bgo-530543-leak-while-syncing-mails-for-offline.diff bgo530543 psankar@suse.de - Fix is in upstream svn from 2.22.2
|
||||
Patch10: bgo-530543-leak-while-syncing-mails-for-offline.diff
|
||||
# PATCH-FIX-UPSTREAM: bgo-531009-right-iterator-to-prevent-crash-in-offline-mail.diff bgo531009 psankar@suse.de - Fix is in upstream svn from 2.22.2
|
||||
Patch11: bgo-531009-right-iterator-to-prevent-crash-in-offline-mail.diff
|
||||
# PATCH-FIX-UPSTREAM: bnc-394654-eds-crasher.patch bnc394654 pchenthill@suse.de --
|
||||
Patch12: bnc-394654-eds-crasher.patch
|
||||
# Change patch below if we move away from /opt/gnome
|
||||
# PATCH-FIX-OPENSUSE libgnomeui-dep.patch -- It avoids a build dependency on libgnomeui to speed up bootstrap
|
||||
Patch99: libgnomeui-dep.patch
|
||||
@ -105,18 +91,11 @@ documentation.
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0
|
||||
%patch1
|
||||
%patch2
|
||||
# %patch1
|
||||
###%patch3
|
||||
###%patch4
|
||||
###%patch5
|
||||
%patch6
|
||||
%patch7
|
||||
%patch8
|
||||
%patch9
|
||||
%patch10
|
||||
%patch11
|
||||
%patch12
|
||||
%patch99
|
||||
|
||||
%build
|
||||
@ -142,7 +121,7 @@ make %{?jobs:-j%jobs}
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
%find_lang evolution-data-server-2.22
|
||||
%find_lang evolution-data-server-2.24
|
||||
rm $RPM_BUILD_ROOT/%{_libdir}/*.*a
|
||||
rm $RPM_BUILD_ROOT/%{_libdir}/*/*/*.*a
|
||||
%fdupes $RPM_BUILD_ROOT
|
||||
@ -157,7 +136,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc README COPYING ChangeLog NEWS TODO AUTHORS
|
||||
%{_datadir}/evolution-data-server-2.22
|
||||
%{_datadir}/evolution-data-server-2.24
|
||||
%{_datadir}/idl/evolution-data-server-1.2
|
||||
%{_datadir}/pixmaps/evolution-data-server
|
||||
%{_libdir}/*.so.*
|
||||
@ -165,11 +144,11 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_prefix}/lib/evolution-data-server
|
||||
%{_libdir}/evolution-data-server-1.2
|
||||
|
||||
%files lang -f evolution-data-server-2.22.lang
|
||||
%files lang -f evolution-data-server-2.24.lang
|
||||
|
||||
%files devel
|
||||
%defattr(-, root, root)
|
||||
%{_includedir}/evolution-data-server-2.22
|
||||
%{_includedir}/evolution-data-server-2.24
|
||||
%{_libdir}/*.so
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
|
||||
@ -178,6 +157,42 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/gtk-doc/html/*
|
||||
|
||||
%changelog
|
||||
* Fri Jun 20 2008 maw@suse.de
|
||||
- Update to version 2.23.4:
|
||||
+ Configurable proxy settings
|
||||
+ Quota support for IMAP
|
||||
+ Google contact API support in libgdata-google
|
||||
+ A lot of IMAP4 improvements
|
||||
+ Use new paths for header files that have been moved to
|
||||
libebackend
|
||||
+ Use "dialog-password" icon instead of "dialog-question" in the
|
||||
password dialog (HIG compliance)
|
||||
+ Bugs fixed: bnc#394654, bgo#304029, bgo#509721, bgo#521921,
|
||||
bgo#527544, bgo#530241, bgo#534080, bgo#534111, bgo#536154,
|
||||
bgo#536636, bgo#318803, bgo#326149, bgo#354923, bgo#374616,
|
||||
bnc#388579, bgo#473658, bgo#518312, bgo#530514, bgo#530543,
|
||||
bgo#530763, bgo#531009, bgo#531439, bgo#531591, bgo#531713,
|
||||
bgo#532286, bgo#533058, bgo#533780, bgo#534077, bgo#534294,
|
||||
bgo#534312, bnc#182380, bgo#274316, bgo#301980, bgo#316390,
|
||||
bgo#325882, bgo#330990, bnc#338330, bgo#347061, bnc#350143,
|
||||
bnc#358584, bnc#358644, bnc#358650, bnc#381307, bnc#382736,
|
||||
bgo#424744, bgo#502899, bgo#517244, bgo#520532, bgo#530139,
|
||||
bgo#530323, bgo#530688, bgo#532284, bgo#235681, bgo#257361,
|
||||
bgo#270406, bgo#271863, bgo#274316, bgo#303067, bgo#341004,
|
||||
bgo#369512, bnc#372383, bgo#417000, bgo#453109, bgo#473880,
|
||||
bgo#475616, bgo#494311, bgo#500389, bgo#514300, bgo#514827,
|
||||
bgo#516608, bgo#518710, bgo#518886, bgo#520526, bgo#521015,
|
||||
bgo#522389, bgo#522433, bgo#523023, bgo#523126, bgo#523528,
|
||||
bgo#523533, bgo#523541, bgo#523630, bgo#518656, bgo#524324,
|
||||
bgo#524704, bgo#525242, bgo#525485, bgo#526138, and bgo#526741
|
||||
+ Updated translations
|
||||
- Drop obsolete patches: bnc-188523-eds-fix-authenticated-proxy-support.diff,
|
||||
bnc-388579-ical-fix-for-exch.patch, bgo-532284-gw-double-free.patch,
|
||||
bgo-533058-gw-debug-logs.patch, bgo-530543-leak-while-syncing-mails-for-offline.diff,
|
||||
bgo-531009-right-iterator-to-prevent-crash-in-offline-mail.diff,
|
||||
and bnc-394654-eds-crasher.patch
|
||||
- Respin following patch:
|
||||
bgo-530514-check-to-handle-specific-server-response.diff.
|
||||
* Mon Jun 02 2008 abharath@suse.de
|
||||
- Added
|
||||
+ bnc#394654 - bnc-394654-eds-crasher.patch: EDS crasher (Chenthill)
|
||||
|
Loading…
Reference in New Issue
Block a user