-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 536 #538
base: master
Are you sure you want to change the base?
Fix 536 #538
Conversation
Well empty line after headers section of response is matched with \r\n\r\n. |
that's untrue, you can have empty line "\n" sent at the beginning :) Which is what I thought was the issue. Anyway let me show the spec about proxies but so far you patch is OK. I think reusing the hackney parser would also do the trick and may reuse more code but that cna be done in another iteration. |
I am not sure it is allowed to have empty line at the beginning, but we do not need to worry about this in the scope of this ticket/contribution. I am only interested in gathering full response from the proxy before allowing a socket to be reused. Any '\n' at the beginning wont break this matching code. I was thinking about using gen_tcp:unrecv in case we overshoot with gen_tcp:recv but it is undocumented....and i wont happen to me ;-) |
I am sorry I am not familiar with hackney code base to reuse existing response parsing code. I just wanted to communicate the problem and to propose working solution. The exact way of solving the problem is not an issue for me, please, feel free to implement your own. I already had my 'high' from understanding what causes the bug ;-) |
Fixes connect tunnel proxy issue where SSL over proxy upgrade was unreliable because garbage was left in socket receive buffer.