evolution-rss r497 - in trunk: . src
- From: lucilanga svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-rss r497 - in trunk: . src
- Date: Tue, 7 Apr 2009 18:27:42 +0000 (UTC)
Author: lucilanga
Date: Tue Apr 7 18:27:42 2009
New Revision: 497
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=497&view=rev
Log:
2009-04-07 Lucian Langa <lucilanga gnome org>
* src/rss-config-factory.c (e_plugin_lib_get_configure_widget): force
min default network_timeout if value if errorneous
* src/rss.c (network_timeout): add patch from Timo Hoenig
<thoenig suse de> fix if network_timeout cannot be read from gconf
Modified:
trunk/ChangeLog
trunk/TODO
trunk/src/network-soup.c
trunk/src/rss-config-factory.c
trunk/src/rss.c
trunk/src/rss.h
Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Tue Apr 7 18:27:42 2009
@@ -10,7 +10,6 @@
* jump to folder when adding through d-bus
* implement other engines besides soup
* implement USM (universal subscription mechanism)
- * fix authentication for proxy dialog
* make auth dialog not intrusive (peek others)
* fix ubuntu crashing when wrong entities (<0.0.6) and feed conf files stored in a file
* implement notify back of imported feed perhaps libnotify
@@ -19,7 +18,6 @@
* implement web controls for diferent redering <Webkits> or <Gecko>
* when adding a feed as opml file offer to import (file detection)
* run-time migration function from text/evolution-rss-feed -> x-evolution/evolution-rss-feed
- * test new proxy authentification
* cache large feeds
* hook feed properties in folder properties
* if necessary implement config code for evo 2.12
@@ -59,3 +57,5 @@
* if immage cannto be served from cache try to fetch it ( add 3 times retry for fetching an image)
* disable filters on setup_feed()
* check s&r progress bar on Complete.
+ * support https proxy
+ * support list of ignored hosts
Modified: trunk/src/network-soup.c
==============================================================================
--- trunk/src/network-soup.c (original)
+++ trunk/src/network-soup.c Tue Apr 7 18:27:42 2009
@@ -190,35 +190,43 @@
gconf_client_get_bool(rss_gconf, RIGHT_KEY(USE_HTTP_PROXY), NULL);
guint proxy_type =
gconf_client_get_int(rss_gconf, KEY_GCONF_EVO_PROXY_TYPE, NULL);
- if (proxy_type != 2) //emulate the same behaviour
- use_proxy = 0;
gint port_proxy =
gconf_client_get_int(rss_gconf, RIGHT_KEY(HTTP_PORT), NULL);
gchar *host_proxy =
gconf_client_get_string(rss_gconf, RIGHT_KEY(HTTP_HOST), NULL);
gboolean auth_proxy =
gconf_client_get_bool(rss_gconf, RIGHT_KEY(HTTP_USE_AUTH), NULL);
- gchar *user_proxy =
- gconf_client_get_string(rss_gconf, RIGHT_KEY(HTTP_AUTH_USER), NULL);
- gchar *pass_proxy =
- gconf_client_get_string(rss_gconf, RIGHT_KEY(HTTP_AUTH_PWD), NULL);
#endif
if (use_proxy && host_proxy && port_proxy > 0)
{
gchar *proxy_uri =
g_strdup_printf("http://%s:%d/", host_proxy, port_proxy);
+ g_free(host_proxy);
+
+ if (auth_proxy) {
+ char *tmp;
+
+ gchar *user_proxy =
+ gconf_client_get_string(rss_gconf, RIGHT_KEY(HTTP_AUTH_USER), NULL);
+ gchar *pass_proxy =
+ gconf_client_get_string(rss_gconf, RIGHT_KEY(HTTP_AUTH_PWD), NULL);
+
+ tmp = proxy_uri;
+
+ proxy_uri = g_strdup_printf ("http://%s:%s %s", user_proxy, pass_proxy, tmp + strlen ("http://"));
+
+ g_free (user_proxy);
+ g_free (pass_proxy);
+ g_free (tmp);
+ }
+ g_print("proxy_uri:%s\n", proxy_uri);
#if LIBSOUP_VERSION < 2003000
SoupUri *puri = soup_uri_new (proxy_uri);
#else
SoupURI *puri = soup_uri_new (proxy_uri);
#endif
-/* if (auth_proxy)
- {
- puri->user = g_strdup(user_proxy);
- puri->passwd = g_strdup(pass_proxy);
- }*/
g_object_set (G_OBJECT (session), SOUP_SESSION_PROXY_URI, puri, NULL);
#if LIBSOUP_VERSION < 2003000
if (puri)
@@ -326,6 +334,12 @@
gpointer data)
#endif
{
+
+ g_print("proxy:\n");
+ g_print("proxy:%d\n", soup_auth_is_for_proxy(auth));
+ if (soup_auth_is_for_proxy(auth))
+ return;
+
gchar *user = g_hash_table_lookup(rf->hruser, data);
gchar *pass = g_hash_table_lookup(rf->hrpass, data);
@@ -502,6 +516,7 @@
if (!rf->key_session)
rf->key_session = g_hash_table_new(g_direct_hash, g_direct_equal);
+
g_signal_connect (soup_sess, "authenticate",
G_CALLBACK (authenticate), (gpointer)url);
#if LIBSOUP_VERSION < 2003000
@@ -517,6 +532,21 @@
soup_status_get_phrase(2)); //invalid url
return -1;
}
+/*
+soup_message_add_header_handler (msg,
+ "got_headers",
+// soup_auth_is_for_proxy (auth) ?
+ "Authentication-Info",
+ G_CALLBACK (authenticate),
+ url);
+soup_message_add_header_handler (msg,
+ "got_headers",
+// soup_auth_is_for_proxy (auth) ?
+ "Proxy-Authentication-Info",
+ G_CALLBACK (authenticate),
+ url);*/
+
+
if (track)
{
//we want to be able to abort this session by calling
Modified: trunk/src/rss-config-factory.c
==============================================================================
--- trunk/src/rss-config-factory.c (original)
+++ trunk/src/rss-config-factory.c Tue Apr 7 18:27:42 2009
@@ -1686,6 +1686,10 @@
ui->nettimeout = glade_xml_get_widget(ui->xml, "nettimeout");
gdouble adj = gconf_client_get_float(rss_gconf, GCONF_KEY_NETWORK_TIMEOUT, NULL);
+ if (adj < NETWORK_MIN_TIMEOUT) {
+ adj = 60;
+ gconf_client_set_float (rss_gconf, GCONF_KEY_NETWORK_TIMEOUT, adj, NULL);
+ }
if (adj)
gtk_spin_button_set_value((GtkSpinButton *)ui->nettimeout, adj);
g_signal_connect(ui->nettimeout, "changed", G_CALLBACK(network_timeout_cb), ui->nettimeout);
Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c (original)
+++ trunk/src/rss.c Tue Apr 7 18:27:42 2009
@@ -748,11 +748,16 @@
void
network_timeout(void)
{
+
if (nettime_id)
g_source_remove(nettime_id);
+
+ float timeout = gconf_client_get_float(rss_gconf, GCONF_KEY_NETWORK_TIMEOUT, NULL);
+ if (!timeout)
+ timeout = NETWORK_MIN_TIMEOUT;
nettime_id = g_timeout_add (
- gconf_client_get_float(rss_gconf, GCONF_KEY_NETWORK_TIMEOUT, NULL)*1000,
+ timeout*1000,
(GtkFunction) timeout_soup,
0);
}
@@ -4212,8 +4217,10 @@
finish_image (SoupSession *soup_sess, SoupMessage *msg, CamelStream *user_data)
#endif
{
+ g_print("finish_image:%d\n", msg->status_code);
// we might need to handle more error codes here
- if (404 != msg->status_code &&
+ if (503 != msg->status_code && //handle this timedly fasion
+ 404 != msg->status_code &&
7 != msg->status_code) {
#if LIBSOUP_VERSION < 2003000
if (msg->response.body) {
Modified: trunk/src/rss.h
==============================================================================
--- trunk/src/rss.h (original)
+++ trunk/src/rss.h Tue Apr 7 18:27:42 2009
@@ -33,6 +33,7 @@
/* ms between status updates to the gui */
#define STATUS_TIMEOUT (250)
+#define NETWORK_MIN_TIMEOUT (60)
#define NETWORK_TIMEOUT (180000)
#define HTTP_CACHE_PATH "http"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]