Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

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

@kenjiuno

Description

@kenjiuno

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions