Code cleanup for network module.

This commit is contained in:
2023-07-11 00:02:14 +08:00
parent c9b348dd4f
commit d89423caf5
4 changed files with 38 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ using System.IO;
using System.Text;
namespace Cryville.Common.Network.Http11 {
public class Http11Response {
public class Http11Response : IDisposable {
static readonly char[] spchar = new char[]{ ' ' };
public string HttpVersion { get; private set; }
public string StatusCode { get; private set; }
@@ -28,6 +28,16 @@ namespace Cryville.Common.Network.Http11 {
}
}
public void Dispose() {
Dispose(true);
}
public virtual void Dispose(bool disposing) {
if (disposing) {
MessageBody.Dispose();
}
}
public override string ToString() {
return string.Format("<{0} {1} {2}>", HttpVersion, StatusCode, ReasonPhase);
}