Skip to content

sslsocket: fix "attempt to redefine 'SSL_*'" error #210

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

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

olegrok
Copy link
Contributor

@olegrok olegrok commented Jun 6, 2025

Different libraries can use FFI OpenSSL bindings.
E.g. cartridge already uses it:
https://github.com/tarantool/cartridge/blob/master/cartridge/sslsocket.lua

Right now there is no any significant difference in cdef. But in future it can be different (e.g. after implementation of #207). Since we use "struct SSL_METHOD {} SSL_METHOD" definition it can cause errors like 'attempt to
redefine 'SSL_METHOD'" that lead to the case then pcall silently handle an error but some symbols won't be defined.

This patch fixes such case.
That's only relevant for struct definitions. Functions and typedefs can be redefined.

Different libraries can use FFI OpenSSL bindings.
E.g. cartridge already uses it:
https://github.com/tarantool/cartridge/blob/master/cartridge/sslsocket.lua

Right now there is no any significant difference in cdef. But in
future it can be different (e.g. after implementation of #207).
Since we use "struct SSL_METHOD {} SSL_METHOD" definition
it can cause errors like 'attempt to
redefine 'SSL_METHOD'" that lead to the case then pcall silently
handle an error but some symbols won't be defined.

This patch fixes such case.
That's only relevant for struct definitions. Functions and typedefs can be redefined.
Copy link
Contributor

@themilchenko themilchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@oleg-jukovec oleg-jukovec removed their request for review June 7, 2025 18:28
@olegrok olegrok merged commit ca1db4d into master Jun 9, 2025
34 checks passed
@olegrok olegrok deleted the fix-ffi-type-declaration branch June 9, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants