Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1294#discussion_r94717201
  
    --- Diff: iocore/net/BIO_fastopen.cc ---
    @@ -27,28 +27,27 @@
     
     #include "BIO_fastopen.h"
     
    -static int
    -fastopen_create(BIO *bio)
    -{
    -  bio->init  = 0;
    -  bio->num   = NO_FD;
    -  bio->flags = 0;
    -  bio->ptr   = nullptr;
    +#if OPENSSL_VERSION_NUMBER < 0x10100000L
    +#define BIO_set_data(a, _ptr) ((a)->ptr = (_ptr))
    +#define BIO_get_data(a) ((a)->ptr)
    +#define BIO_get_shutdown(a) ((a)->shutdown)
    +#define BIO_meth_get_ctrl(biom) ((biom)->ctrl)
    +#define BIO_meth_get_create(biom) ((biom)->create)
    +#define BIO_meth_get_destroy(biom) ((biom)->destroy)
    +#endif
     
    -  return 1;
    -}
    +static int (*fastopen_create)(BIO *) = 
BIO_meth_get_create(const_cast<BIO_METHOD *>(BIO_s_socket()));
     
     static int
     fastopen_destroy(BIO *bio)
     {
       if (bio) {
         // We expect this BIO to not own the socket, so we must always
         // be in NOCLOSE mode.
    -    ink_assert(bio->shutdown == BIO_NOCLOSE);
    -    fastopen_create(bio);
    +    ink_assert(BIO_get_shutdown(bio) == BIO_NOCLOSE);
       }
     
    -  return 1;
    +  return BIO_meth_get_destroy(const_cast<BIO_METHOD 
*>(BIO_s_socket()))(bio);
    --- End diff --
    
    Seems pretty unfortunate that they make you cast away the const here :(


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to