mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-09 14:58:18 +02:00
All matching opened files will now be closed during connection termination
This commit is contained in:
parent
9141665ac6
commit
900ff25a3c
4 changed files with 24 additions and 1 deletions
|
@ -40,6 +40,7 @@ namespace SMBLibrary.Server
|
||||||
{
|
{
|
||||||
connection.SendQueue.Stop();
|
connection.SendQueue.Stop();
|
||||||
SocketUtils.ReleaseSocket(connection.ClientSocket);
|
SocketUtils.ReleaseSocket(connection.ClientSocket);
|
||||||
|
connection.CloseSessions();
|
||||||
RemoveConnection(connection);
|
RemoveConnection(connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,13 @@ namespace SMBLibrary.Server
|
||||||
Dialect = state.Dialect;
|
Dialect = state.Dialect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Free all resources used by the active sessions in this connection
|
||||||
|
/// </summary>
|
||||||
|
public virtual void CloseSessions()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void LogToServer(Severity severity, string message)
|
public void LogToServer(Severity severity, string message)
|
||||||
{
|
{
|
||||||
message = String.Format("[{0}] {1}", ConnectionIdentifier, message);
|
message = String.Format("[{0}] {1}", ConnectionIdentifier, message);
|
||||||
|
|
|
@ -88,6 +88,16 @@ namespace SMBLibrary.Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void CloseSessions()
|
||||||
|
{
|
||||||
|
foreach (SMB1Session session in m_sessions.Values)
|
||||||
|
{
|
||||||
|
session.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_sessions.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An open TID MUST be unique within an SMB connection.
|
/// An open TID MUST be unique within an SMB connection.
|
||||||
/// The value 0xFFFF MUST NOT be used as a valid TID. All other possible values for TID, including zero (0x0000), are valid.
|
/// The value 0xFFFF MUST NOT be used as a valid TID. All other possible values for TID, including zero (0x0000), are valid.
|
||||||
|
|
|
@ -69,8 +69,13 @@ namespace SMBLibrary.Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearSessions()
|
public override void CloseSessions()
|
||||||
{
|
{
|
||||||
|
foreach (SMB2Session session in m_sessions.Values)
|
||||||
|
{
|
||||||
|
session.Close();
|
||||||
|
}
|
||||||
|
|
||||||
m_sessions.Clear();
|
m_sessions.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue