-
Notifications
You must be signed in to change notification settings - Fork 58
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
Issues for general cleanup? #143
Comments
One task would be to adjust existing code to follow the basic coding style outlined in CONTRIBUTING and enforce contributions to follow that style. In another project, I am currently testing a |
Regarding license update: What would be the reasons for undergoing the enormous pain of changing the license model? I presume you would not do this unless there is something entirely wrong with the existing EPL v1.0/EDL v1.0. |
I may be wrong, but I assume, a new release requires a 2.0.
Because the difference in the license? Or because the editing? |
Okay, more reading to do for release preparation. The pain arises from reading legal stuff: All tinydtls users will have to make their lawyers process the new license. It is not the editing that makes license changes difficult but the changed contents of the license. I have not yes compared the two documents or read discussions that may have commented on the changes but then again, this is exactly what I meant with "pain". |
Yes, some may require to read it. |
As long as the tool is used manually, that should not cause too much trouble. I would propose to go with one commit with the applied format, and one commit (maybe one per file), which need manual corrections of that. |
If agreed, we may also update the copyright times for the EPL files. |
My first experience with ".clang-format" using VS Code is promising. (When it gets clear, how many section requires a custom format, we may consider again to use the "protection comments".) |
Follow the coding conventions, e.g.:
(The function name starts on its own line, the opening brace is on the same line as the last formal parameter.) |
As a comment, 74 of the git tracked files have lines that end in white space. Things code wise need to be stable before this is changed. It can get a bit annoying, but I just now
which will then trap any files I am trying to commit with whitespace errors (have been doing this for some time in libcoap) |
In my experience, it easier to do such cleanup on a "code-freeze" period. |
Discussing the use/design of macros in PR #217 showed, that we also need some rules for macros. |
Any passed-in parameters must be wrapped with ( ) within the the macro definition as the passed-in parameter could be more than just a single variable (e.g. operation on the variable, or sum of 2 variables). |
Any macro definition of "calculated values" must also be wrapped with ( ). I'm not sure, if the rules should only be applied to API macros or also to internal macros. |
It should be a matter of principle for both API and internal only macros. |
Some pain points/things that could be cleaned up from my experience from using tinydtls on zephyr:
Addressing these would require some quite extensive changes and break API, so I'd understand if this goes beyond the scope of your planned cleanup. FWIW I'd be interested in tackling these if there's interest. |
Thanks for your message. For now tinydtls uses several mechanisms for platform abstraction and none consequently. That needs a cleanup. But for also now my feeling is, that we need to focus on the pending PRs and smaller polish stuff. About the read/write handling. One reason for that API is, that in some cases during the handshake, one call to "dtls_handle_message" may cause several calls to the write API for several handshake messages.
The About Anyway, though you use zephyr, I guess I should contribute a small update about the includes. |
The problem is when the required context is on the stack (e.g. receiving a msg and wanting to decode it to a buffer on the stack or passed in from somewhere else as a pointer again - e.g. when building a socket abstraction on top of tinydtls), then you need to update your app context to point to your specific buffer every time. It works, but is quite confusing to parse and not very intuitive.
I see. But that could also be handled by a return value like EAGAIN, iirc that's also how e.g. mbedtls does it.
Not necessarily in a way that can be used directly with tinydtls though (e.g. in zephyrs tls_credential subsystem). So instead of storing a copy statically somewhere you could only load it on demand to the stack for the two times it's required. But yeah, as I mentioned, this is pretty minor. |
Yes, that case isn't a easy one with the current API.
Yes, supporting such an API is also not easy. Let's try to get the PRs done and see, what we can agree with the other committers. |
I spend some time in investigation to overcome that. What do you think? |
If the API is changed, with the potential of different versions of TinyDTLS to dynamically link against would be a nightmare for me (with libcoap) without having an API version change away from 0.8.6 that can be picked up in the PACKAGE_VERSION variable. Some devices have constrained stack sizes, but I don't think an extra 32 bytes should be a significant issue. For GnuTLS and wolfSSL, functions are called to define the RPK keys from user application, rather than having them acquired using a callback handler. |
Maybe, adding an second "callback" as extension and document to migrate? (I guess, the callbacks are used in order to keep the data in the library only for a short time.) |
Migrating document is not useful for me as there may be an existing libtinydtls.so file that could be pre or post this API change on system A where the application executable was built on a different server and then installed on system A via some package manager. |
that should not affect existing code. |
Adding an extra callback to |
As mentioned in add ccm - comment on too many whitespace change the current code seems the have a mixed up format.
Therefore I would like to collect some input for a general cleanup.
From my side:
dtls_debug_dump
already with a ":" at the end of the name),dtls_debug
.Such general cleanups usually "locks the code for some time", so maybe it's also worth to get some feedback, what should be done before (e.g. merging selected open PRs).
The text was updated successfully, but these errors were encountered: