فهرست منبع

Improved NetBIOS related exception messages and documentation

Tal Aloni 8 سال پیش
والد
کامیت
3f78fb81ff
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 2 1
      SMBLibrary/NetBios/NBTConnectionReceiveBuffer.cs
  2. 1 1
      SMBLibrary/NetBios/SessionPackets/SessionPacket.cs

+ 2 - 1
SMBLibrary/NetBios/NBTConnectionReceiveBuffer.cs

@@ -55,6 +55,7 @@ namespace SMBLibrary.NetBios
         /// HasCompletePacket must be called and return true before calling DequeuePacket
         /// HasCompletePacket must be called and return true before calling DequeuePacket
         /// </summary>
         /// </summary>
         /// <exception cref="System.IO.InvalidDataException"></exception>
         /// <exception cref="System.IO.InvalidDataException"></exception>
+        /// <exception cref="SMBLibrary.InvalidRequestException"></exception>
         public SessionPacket DequeuePacket()
         public SessionPacket DequeuePacket()
         {
         {
             SessionPacket packet;
             SessionPacket packet;
@@ -64,7 +65,7 @@ namespace SMBLibrary.NetBios
             }
             }
             catch (IndexOutOfRangeException ex)
             catch (IndexOutOfRangeException ex)
             {
             {
-                throw new System.IO.InvalidDataException("Invalid Packet", ex);
+                throw new System.IO.InvalidDataException("Invalid NetBIOS session packet", ex);
             }
             }
             RemovePacketBytes();
             RemovePacketBytes();
             return packet;
             return packet;

+ 1 - 1
SMBLibrary/NetBios/SessionPackets/SessionPacket.cs

@@ -73,7 +73,7 @@ namespace SMBLibrary.NetBios
                 case SessionPacketTypeName.SessionKeepAlive:
                 case SessionPacketTypeName.SessionKeepAlive:
                     return new SessionKeepAlivePacket(buffer, offset);
                     return new SessionKeepAlivePacket(buffer, offset);
                 default:
                 default:
-                    throw new InvalidRequestException("Invalid NetBIOS Session Packet");
+                    throw new InvalidRequestException("Invalid NetBIOS session packet type");
             }
             }
         }
         }
     }
     }