From 3f8d0db77387bad19acb743dc80b336ce0655d47 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Thu, 17 Mar 2011 21:58:06 +0000 Subject: expose max connections and max host connections for extra vroom vroom. news.google.com in like 300ms ;-) --- xxxterm.1 | 8 ++++++++ xxxterm.c | 9 +++++++++ xxxterm.conf | 2 ++ 3 files changed, 19 insertions(+) diff --git a/xxxterm.1 b/xxxterm.1 index b13a437..e5639dc 100644 --- a/xxxterm.1 +++ b/xxxterm.1 @@ -781,6 +781,14 @@ This is a Java Script whitelist item. See .Cm cookie_wl for semantics and more details. +.It Cm max_connections +The maximum number of connections that +.Nm +can open at once. +.It Cm max_host_connections +The maximum number of connections that +.Nm +can open at once to a given host. .It Cm mime_type Sets an action for a specific or default MIME type. For example, to download and view a pdf using kpdf set diff --git a/xxxterm.c b/xxxterm.c index 05570ae..ba11bfb 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -494,6 +494,8 @@ int save_rejected_cookies = 0; time_t session_autosave = 0; int guess_search = 0; int dns_prefetch = FALSE; +gint max_connections = 25; +gint max_host_connections = 5; struct settings; struct key_binding; @@ -616,6 +618,8 @@ struct settings { { "home", XT_S_STR, 0, NULL, &home, NULL }, { "http_proxy", XT_S_STR, 0, NULL, &http_proxy, NULL }, { "icon_size", XT_S_INT, 0, &icon_size, NULL, NULL }, + { "max_connections", XT_S_INT, XT_SF_RESTART,&max_connections, NULL, NULL }, + { "max_host_connections", XT_S_INT, XT_SF_RESTART,&max_host_connections, NULL, NULL }, { "read_only_cookies", XT_S_INT, 0, &read_only_cookies, NULL, NULL }, { "refresh_interval", XT_S_INT, 0, &refresh_interval, NULL, NULL }, { "resource_dir", XT_S_STR, 0, NULL, &resource_dir, NULL }, @@ -8303,6 +8307,11 @@ main(int argc, char *argv[]) exit(0); } + /* set some connection parameters */ + g_object_set(session, "max-conns", max_connections, (char *)NULL); + g_object_set(session, "max-conns-per-host", max_host_connections, + (char *)NULL); + /* see if there is already an xxxterm running */ if (single_instance && is_running()) { optn = 1; diff --git a/xxxterm.conf b/xxxterm.conf index 87495cb..197f08d 100644 --- a/xxxterm.conf +++ b/xxxterm.conf @@ -26,6 +26,8 @@ # show_statusbar = 0 # session_autosave = 0 # guess_search = 0 +# max_host_connections = 5 +# max_connections = 25 # # resource_dir = /usr/local/share/xxxterm/ -- cgit 1.4.1-2-gfad0