Skip to content
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 GC.compact compatibility #465

Merged
merged 3 commits into from Oct 16, 2021

Commits on Oct 14, 2021

  1. ssl: explicitly call rb_gc_mark() against SSLContext/SSLSocket objects

    We store the reverse reference to the Ruby object in the OpenSSL
    struct for use from OpenSSL callback functions. To prevent the Ruby
    object from being relocated by GC.compact, we must "pin" it by calling
    rb_gc_mark().
    rhenium committed Oct 14, 2021
    Copy the full SHA
    022b7ce View commit details
    Browse the repository at this point in the history
  2. x509store: explicitly call rb_gc_mark() against Store/StoreContext

    We store the reverse reference to the Ruby object in the OpenSSL
    struct for use from OpenSSL callback functions. To prevent the Ruby
    object from being relocated by GC.compact, we must "pin" it by calling
    rb_gc_mark().
    rhenium committed Oct 14, 2021
    Copy the full SHA
    a6ba9f8 View commit details
    Browse the repository at this point in the history
  3. ssl: avoid directly storing String object in NPN callback

    On the server side, the serialized list of protocols is stored in
    SSL_CTX as a String object reference. We utilize a hidden instance
    variable to prevent it from being GC'ed, but this is not enough because
    it can also be relocated by GC.compact.
    rhenium committed Oct 14, 2021
    Copy the full SHA
    5eb68ba View commit details
    Browse the repository at this point in the history