SuperSocket.ClientEngine
SuperSocket.ClientEngine copied to clipboard
Fix: HttpConnectProxy partial support for Titanium/Apache, and add tests
Report from #92
- Receiving
\r\n\r\nat end of second buffer, it leads toSystem.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!