summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2018-07-26 10:36:08 +0200
committerOndrej Holy <oholy@redhat.com>2018-07-26 14:29:23 +0200
commit7b991137b8a820f018ddaa970d54f91d1f411a0f (patch)
tree29e98e75733688497908db61272f5f3c8d8c0d94 /daemon
parentc340056a010182aa6c0f082fd0500105f6415d65 (diff)
downloadgvfs-7b991137b8a820f018ddaa970d54f91d1f411a0f.tar.gz
dav: Increase max number of connections to prevent lockups
Currently, the default value of max-conns-per-host libsoup property is used, which causes dav backend lockups if two files are opened. I don't see any easy solution how to prevent lockups, but we can definitely reduce the chance of them by increasing max-conns properties. Much bigger values are used by browsers nowadays. Hope that 32 is big enough for regular use cases and small enough to not flood a server and not block too much file descriptors... Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/6
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gvfsbackenddav.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 6591f149..5572793d 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -66,6 +66,10 @@
#include "gvfsdnssdresolver.h"
#endif
+/* Overwrite maximal number of connections that libsoup can open in one time in
+ order to prevent backend lockups when too many files is opened concurrently. */
+#define MAX_CONNS 32
+
typedef struct _MountAuthData MountAuthData;
static void mount_auth_info_free (MountAuthData *info);
@@ -1875,7 +1879,11 @@ do_mount (GVfsBackend *backend,
G_VFS_BACKEND_HTTP (backend)->mount_base = mount_base;
/* Override the HTTP backend's default. */
- g_object_set (session, "ssl-strict", TRUE, NULL);
+ g_object_set (session,
+ "ssl-strict", TRUE,
+ SOUP_SESSION_MAX_CONNS_PER_HOST, MAX_CONNS,
+ SOUP_SESSION_MAX_CONNS, MAX_CONNS,
+ NULL);
data = &(G_VFS_BACKEND_DAV (backend)->auth_info);
data->mount_source = g_object_ref (mount_source);