From 0dde935ffee45b8338cc2d4ba9f01094ae7bd5ad Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Fri, 31 Jan 2020 10:49:19 +0200 Subject: [PATCH] Client: Minor code refactoring --- SMBLibrary/Client/SMB1Client.cs | 3 ++- SMBLibrary/Client/SMB2Client.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SMBLibrary/Client/SMB1Client.cs b/SMBLibrary/Client/SMB1Client.cs index f523aaf..8161cea 100644 --- a/SMBLibrary/Client/SMB1Client.cs +++ b/SMBLibrary/Client/SMB1Client.cs @@ -677,7 +677,8 @@ namespace SMBLibrary.Client { try { - socket.Send(packet.GetBytes()); + byte[] packetBytes = packet.GetBytes(); + socket.Send(packetBytes); } catch (SocketException) { diff --git a/SMBLibrary/Client/SMB2Client.cs b/SMBLibrary/Client/SMB2Client.cs index ce91076..336aaa2 100644 --- a/SMBLibrary/Client/SMB2Client.cs +++ b/SMBLibrary/Client/SMB2Client.cs @@ -523,7 +523,8 @@ namespace SMBLibrary.Client { try { - socket.Send(packet.GetBytes()); + byte[] packetBytes = packet.GetBytes(); + socket.Send(packetBytes); } catch (SocketException) {