Commit 4fee1b1c authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfsv4: change session format.

The old format hat a bug whish was producing longer
id than nfs spec is allow.

Acked-by: Gerd
Patch: http://rb.dcache.org/r/1029/
parent 2946aa76
package org.dcache.chimera.nfs.v4;
import java.util.List;
import org.dcache.chimera.nfs.ChimeraNFSException;
import java.util.concurrent.atomic.AtomicLong;
import org.dcache.chimera.nfs.ChimeraNFSException;
import org.dcache.chimera.nfs.v4.xdr.nfs4_prot;
import org.dcache.chimera.nfs.v4.xdr.sessionid4;
import org.dcache.chimera.nfs.v4.xdr.nfs_resop4;
import org.dcache.chimera.nfs.v4.xdr.nfsstat4;
......@@ -12,8 +13,8 @@ public class NFSv41Session {
private static final AtomicLong SESSIONS = new AtomicLong(0);
private final sessionid4 _session =
new sessionid4((Long.toString(SESSIONS.incrementAndGet()) + "###############").getBytes());
private final sessionid4 _session;
/**
* Session reply slots.
*/
......@@ -24,6 +25,10 @@ public class NFSv41Session {
public NFSv41Session(NFS4Client client, int replyCacheSize) {
_client = client;
_slots = new SessionSlot[replyCacheSize];
long newSession = SESSIONS.incrementAndGet();
byte[] id = String.format("%16X", newSession ).getBytes();
assert id.length == nfs4_prot.NFS4_SESSIONID_SIZE;
_session = new sessionid4(id);
}
public sessionid4 id() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment