Sync API: Once the sync nfs_mount() functions is finished we have to clear rpc->conne...
[deb_libnfs.git] / lib / libnfs.c
index c1b4962caffa1efb3e7fdf8b68d3502f7c87b493..a4b4a62d4f79576aca7b994ac4d25abec93a5be6 100644 (file)
@@ -111,7 +111,7 @@ struct nfs_mcb_data {
 static int nfs_lookup_path_async_internal(struct nfs_context *nfs, struct nfs_cb_data *data, struct nfs_fh3 *fh);
 
 
-void nfs_set_auth(struct nfs_context *nfs, struct AUTH *auth)
+void nfs_set_auth(struct nfs_context *nfs, AUTH *auth)
 {
        rpc_set_auth(nfs->rpc, auth);
 }
@@ -352,6 +352,8 @@ 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);
 }
 
 
@@ -499,12 +501,10 @@ int nfs_mount_async(struct nfs_context *nfs, const char *server, const char *exp
        new_export = strdup(export);
        if (nfs->server != NULL) {
                free(nfs->server);
-               nfs->server = NULL;
        }
        nfs->server        = new_server;
        if (nfs->export != NULL) {
                free(nfs->export);
-               nfs->export = NULL;
        }
        nfs->export        = new_export;
        data->nfs          = nfs;