about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--xxxterm.18
-rw-r--r--xxxterm.c9
-rw-r--r--xxxterm.conf2
3 files changed, 19 insertions, 0 deletions
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/