Commit 1f1f6a0e authored by Victor's avatar Victor Committed by Julien Fontanet

fix: reset connection metadata on reconnection (#42)

parent db1e2114
......@@ -31,9 +31,6 @@ var SMB = (module.exports = function(opt) {
// set default port
this.port = opt.port || port;
// set message id
this.messageId = 0;
// extract share
this.share = matches[2];
......@@ -55,9 +52,6 @@ var SMB = (module.exports = function(opt) {
this.username = opt.username;
this.password = opt.password;
// set session id
this.SessionId = Math.floor(Math.random() * 256) & 0xff;
// set the process id
// https://msdn.microsoft.com/en-us/library/ff470100.aspx
this.ProcessId = Buffer.from([
......
......@@ -90,6 +90,12 @@ function connect(connection, cb) {
cb = scheduleAutoClose(connection, cb);
// set message id
connection.messageId = 0;
// set session id
connection.SessionId = Math.floor(Math.random() * 256) & 0xff;
// open TCP socket
connection.socket.connect(
connection.port,
......
Markdown is supported
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