RecordPreview.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tls
  5. {
  6. public sealed class RecordPreview
  7. {
  8. private readonly int recordSize;
  9. private readonly int contentLimit;
  10. internal static RecordPreview CombineAppData(RecordPreview a, RecordPreview b)
  11. {
  12. return new RecordPreview(a.RecordSize + b.RecordSize, a.ContentLimit + b.ContentLimit);
  13. }
  14. internal static RecordPreview ExtendRecordSize(RecordPreview a, int recordSize)
  15. {
  16. return new RecordPreview(a.RecordSize + recordSize, a.ContentLimit);
  17. }
  18. internal RecordPreview(int recordSize, int contentLimit)
  19. {
  20. this.recordSize = recordSize;
  21. this.contentLimit = contentLimit;
  22. }
  23. public int ContentLimit
  24. {
  25. get { return contentLimit; }
  26. }
  27. public int RecordSize
  28. {
  29. get { return recordSize; }
  30. }
  31. }
  32. }
  33. #pragma warning restore
  34. #endif