-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ssl: Add support for {active,N} #2072
Conversation
We will start with testing what you got, more feedback will come once more people are back from the Christmas and New Year holidays. |
We have not had time to review the code yet but the new test is failing quite a lot.
|
How did you get these line numbers? 2090 is not inside a fun here. Could you point in the diff where it occurs? Thanks. |
I built ssl on your PR branch and then I get the following:
|
I can reproduce. I was running this test case directly but when running the test suite it fails against some configurations indeed. DTLS is expected, sslv3 and tls1 are not. Will investigate. |
I have pushed a fix for the sslv3 and tls1 cases. I have not yet looked into implementing DTLS but I will soon. |
As the option is emulated and never set on the real socket the handling ought to be quite similar. |
I've pushed the commit for DTLS. The tests pass and the functionality should be complete. Documentation will still need to be updated. The code looks very similar between tls/dtls but it's difficult to abstract because of small differences between tls_socket/dtls_socket. Open to suggestions. |
And one more push to remove some unnecessary code and hopefully fix Dialyzer. Edit: Fixed! |
The below is no longer true form the user perspective. An optimization will add those two application data TLS-records into one application data delivery. Hopefully I can merge my branch in the beginning of next week so that you can see it to. Otherwise test seems to be doing good now. I hope my team will have some time to look closer at the code soon.
|
Sounds good! |
Due to test problems unrelated to the ssl application I can not merge today. But hopefully tomorrow we I can merge so that you can remove multiplier workaround in the test case. When it comes to the documentation it probably does not need to be so extensive and mostly refer to inet. As it happens I am just in the process of reworking the documentation to use type specs so preferably we will postpone the documentation until I am done with that. |
I will try removing the unreachable clause tomorrow and I will then wait for the documentation. Note that the documentation in inet doesn't mention |
I have now merge my optimization sha: 6ce69af that |
I've rebased and removed the multiplier workaround. |
throw(einval); | ||
{_, N} when is_integer(N), N > 32767 -> | ||
throw(einval); | ||
{_, N} when is_integer(N) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check of active N value is done in several places in a similar way, I was thinking it could be nice with some helper function that preforms the actual check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little difficult to have a common check_active_n
because we have 3 scenarios where it is called: DTLS sockets, TLS sockets and TLS listening sockets. The code path for each of these is different. In the implementation of this PR the latter 2 share a common check_active_n
while DTLS has its own. I'm not seeing an obvious way to share the code between the 3 currently.
Of course the two clauses checking the upper and lower bounds are common but we don't gain much (if anything) from refactoring that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok. See my comment about the active check/calculation code.
/BMK
I'll try to refactor a bit. |
I tried to put your branch in testing again, but I am afraid that my branch that shrinks the outer state record,that I merged today creates some problems for your branch. Could you please rebase on latest maint. |
That is problems are not seen as merge conflicts but rather as compiler errors after merging as state data has been moved around a lot. |
I have fixed the issue. This also made one of the tests fail. The fix is in the most recent commit. Please check it. Not sure it is necessary to update |
I think the code is looking good :) And I do think that it will be sufficient for now to update the socket_options in the place that you have. However, it might be interesting to handle this |
We are currently running our own branch that includes you commits to speed up testing so it can make OTP-21.3, as this time we got new collisions with our changes. |
Glad to hear, especially considering I am fairly busy at the moment. |
All good? |
Yes it is looking good, we will merge our version of the branch today. I was away on "sports holiday" (Swedish kids has a week of school to do winter sports) last week there of the delay. |
Swedish kids are lucky. :-) Cheers |
I did a local repository merge to resolve the merge conflict. |
There's probably missing stuff for DTLS, and the documentation is also missing, but this is a good time to get a first review. The added tests pass and check the option with listen, server and client sockets. I'll probably need some guidance about DTLS.All functionality is there and tests pass! Documentation and possibly some refactoring remains.