Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,16 +768,6 @@ func (conn *conn) runReceiver() {

continue
}

if tc, ok := s.treeConnTables[p.TreeId()]; ok {
if tc.treeId != p.TreeId() {
conn.freePoolBuf(rb)

logger.Println("skip:", &InvalidResponseError{"unknown tree id"})

continue
}
}
}
}

Expand Down
27 changes: 12 additions & 15 deletions conn_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,8 @@ func BenchmarkReadAt(b *testing.B) {
defer cleanup()

c.session.Store(&session{
conn: c,
treeConnTables: make(map[uint32]*treeConn),
sessionFlags: smb2.SMB2_SESSION_FLAG_IS_GUEST,
conn: c,
sessionFlags: smb2.SMB2_SESSION_FLAG_IS_GUEST,
})

responseData := make([]byte, sz.n)
Expand Down Expand Up @@ -241,12 +240,11 @@ func BenchmarkReadAt(b *testing.B) {
}

c.session.Store(&session{
conn: c,
treeConnTables: make(map[uint32]*treeConn),
sessionFlags: smb2.SMB2_SESSION_FLAG_ENCRYPT_DATA,
sessionId: 0xdeadbeef,
encrypter: newGCM(keyC2S),
decrypter: newGCM(keyS2C),
conn: c,
sessionFlags: smb2.SMB2_SESSION_FLAG_ENCRYPT_DATA,
sessionId: 0xdeadbeef,
encrypter: newGCM(keyC2S),
decrypter: newGCM(keyS2C),
})
c.useSession.Store(true)

Expand Down Expand Up @@ -342,12 +340,11 @@ func BenchmarkRoundTrip(b *testing.B) {
}

c.session.Store(&session{
conn: c,
treeConnTables: make(map[uint32]*treeConn),
sessionFlags: smb2.SMB2_SESSION_FLAG_ENCRYPT_DATA,
sessionId: 0xdeadbeef,
encrypter: newGCM(keyC2S),
decrypter: newGCM(keyS2C),
conn: c,
sessionFlags: smb2.SMB2_SESSION_FLAG_ENCRYPT_DATA,
sessionId: 0xdeadbeef,
encrypter: newGCM(keyC2S),
decrypter: newGCM(keyS2C),
})
c.useSession.Store(true)

Expand Down
8 changes: 3 additions & 5 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ func sessionSetup(ctx context.Context, conn *conn, i Initiator) (*session, error
}

s := &session{
conn: conn,
treeConnTables: make(map[uint32]*treeConn),
sessionFlags: sessionFlags,
sessionId: p.SessionId(),
conn: conn,
sessionFlags: sessionFlags,
sessionId: p.SessionId(),
}

switch conn.dialect {
Expand Down Expand Up @@ -262,7 +261,6 @@ func sessionSetup(ctx context.Context, conn *conn, i Initiator) (*session, error

type session struct {
*conn
treeConnTables map[uint32]*treeConn
sessionFlags uint16
sessionId uint64
preauthIntegrityHashValue [64]byte
Expand Down
Loading