From: Ross Lagerwall Date: Sat, 19 Jul 2014 10:32:40 +0000 (+0100) Subject: libnfs.c: Fix autoreconnect X-Git-Tag: upstream/1.9.6^2~18^2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=28ee9de2e458640310b7a41ac6c12d7d23ff2c6a;p=deb_libnfs.git libnfs.c: Fix autoreconnect Since rpc_connect_async sets autoreconnect to 0, turn autoreconnect on after the connection has completed, not before. This fixes #76. Signed-off-by: Ross Lagerwall --- diff --git a/lib/libnfs.c b/lib/libnfs.c index 94f03cb..67c3c85 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -771,6 +771,9 @@ static void nfs_mount_8_cb(struct rpc_context *rpc, int status, void *command_da return; } + /* NFS TCP connections we want to autoreconnect after sessions are torn down (due to inactivity or error) */ + rpc_set_autoreconnect(rpc); + args.fsroot = nfs->rootfh; if (rpc_nfs3_fsinfo_async(rpc, nfs_mount_9_cb, &args, data) != 0) { data->cb(-ENOMEM, nfs, command_data, data->private_data); @@ -823,9 +826,6 @@ static void nfs_mount_6_cb(struct rpc_context *rpc, int status, void *command_da free_nfs_cb_data(data); return; } - - /* NFS TCP connections we want to autoreconnect after sessions are torn down (due to inactivity or error) */ - rpc_set_autoreconnect(rpc); }