SuperSocket.ClientEngine icon indicating copy to clipboard operation
SuperSocket.ClientEngine copied to clipboard

Fix: HttpConnectProxy partial support for Titanium/Apache, and add tests

Open kenjiuno opened this issue 6 years ago • 0 comments

Report from #92

  • Receiving \r\n\r\n at end of second buffer, it leads to System.Exception: protocol error: more data has been received

first:

HTTP/1.1 200 Connection Established\r\n

second:

content-length: 0\r\n\r\n

Possible fix by #92 suggestion:

index 741cabf..314da50 100644
--- a/Proxy/HttpConnectProxy.cs
+++ b/Proxy/HttpConnectProxy.cs
@@ -171,7 +171,7 @@ namespace SuperSocket.ClientEngine.Proxy
                 return;
             }

-            int responseLength = prevMatched > 0 ? (e.Offset - prevMatched) : (e.Offset + result);
+            int responseLength = (prevMatched > 0 && result == e.Offset) ? (e.Offset - prevMatched) : result;

             if (e.Offset + e.BytesTransferred > responseLength + m_LineSeparator.Length)
             {

PR and test will be pushed soon!

kenjiuno avatar Sep 24 '19 05:09 kenjiuno