Commit 57eaedb5 authored by Lucian Langa's avatar Lucian Langa Committed by Lucian Langa
Browse files

force min default network_timeout if value if errorneous add patch from

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

svn path=/trunk/; revision=497
parent 6ed69b08
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
2009-04-06 Lucian Langa <lucilanga@gnome.org>
* src/network-soup.c:
......
......@@ -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
......@@ -190,35 +190,43 @@ proxify_session(SoupSession *session)
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 @@ authenticate (SoupSession *session,
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 @@ net_get_unblocking(const char *url,
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 @@ net_get_unblocking(const char *url,
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
......
......@@ -1686,6 +1686,10 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
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);
......
......@@ -748,11 +748,16 @@ timeout_soup(void)
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 (SoupMessage *msg, CamelStream *user_data)
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) {
......
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment