summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dillorc5
-rw-r--r--src/IO/http.c3
-rw-r--r--src/prefs.c1
-rw-r--r--src/prefs.h1
-rw-r--r--src/prefsparser.cc1
5 files changed, 10 insertions, 1 deletions
diff --git a/dillorc b/dillorc
index b7903aa6..0ac2773a 100644
--- a/dillorc
+++ b/dillorc
@@ -175,6 +175,11 @@ search_url="Google http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%s"
# Maximum number of simultaneous TCP connections to a single server or proxy.
# http_max_conns=6
+# Change this if you want Dillo to reuse HTTP connections to a server or proxy
+# when possible instead of making a new connection for every request for a new
+# page/image/stylesheet. Currently, HTTPS connections are never reused.
+#http_persistent_conns=NO
+
# Set the proxy information for http.
# Note that the http_proxy environment variable overrides this setting.
# WARNING: FTP and downloads plugins use wget. To use a proxy with them,
diff --git a/src/IO/http.c b/src/IO/http.c
index 917cb95e..1be94e0d 100644
--- a/src/IO/http.c
+++ b/src/IO/http.c
@@ -291,7 +291,8 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, const DilloUrl *requester,
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
const char *connection_hdr_val =
- dStrAsciiCasecmp(URL_SCHEME(url), "http") == 0 ? "keep-alive" : "close";
+ (prefs.http_persistent_conns == TRUE &&
+ !dStrAsciiCasecmp(URL_SCHEME(url), "http")) ? "keep-alive" : "close";
if (use_proxy) {
dStr_sprintfa(request_uri, "%s%s",
diff --git a/src/prefs.c b/src/prefs.c
index cd13aac8..56e02006 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -63,6 +63,7 @@ void a_Prefs_init(void)
prefs.http_language = NULL;
prefs.http_proxy = NULL;
prefs.http_max_conns = 6;
+ prefs.http_persistent_conns = FALSE;
prefs.http_proxyuser = NULL;
prefs.http_referer = dStrdup(PREFS_HTTP_REFERER);
prefs.http_user_agent = dStrdup(PREFS_HTTP_USER_AGENT);
diff --git a/src/prefs.h b/src/prefs.h
index bb97651e..0e54e0fc 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -91,6 +91,7 @@ typedef struct {
bool_t load_background_images;
bool_t load_stylesheets;
bool_t parse_embedded_css;
+ bool_t http_persistent_conns;
int32_t buffered_drawing;
char *font_serif;
char *font_sans_serif;
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index 81b097e7..ce420eac 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -73,6 +73,7 @@ int PrefsParser::parseOption(char *name, char *value)
{ "home", &prefs.home, PREFS_URL },
{ "http_language", &prefs.http_language, PREFS_STRING },
{ "http_max_conns", &prefs.http_max_conns, PREFS_INT32 },
+ { "http_persistent_conns", &prefs.http_persistent_conns, PREFS_BOOL },
{ "http_proxy", &prefs.http_proxy, PREFS_URL },
{ "http_proxyuser", &prefs.http_proxyuser, PREFS_STRING },
{ "http_referer", &prefs.http_referer, PREFS_STRING },