Github user PSUdaemon commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/1294#discussion_r94472934 --- Diff: iocore/net/BIO_fastopen.cc --- @@ -27,13 +27,26 @@ #include "BIO_fastopen.h" +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#define BIO_set_data(a, ptr) ((a)->ptr = (ptr)) +#define BIO_get_data(a) ((a)->ptr) +#define BIO_set_init(a, init) ((a)->init = (init)) +#define BIO_set_shutdown(a, shut) ((a)->shutdown = (shut)) +#define BIO_get_shutdown(a) ((a)->shutdown) +#endif + +struct Data { + Data() : fd(NO_FD), dst(nullptr) {} + int fd; + const sockaddr *dst; +}; + static int fastopen_create(BIO *bio) { - bio->init = 0; - bio->num = NO_FD; - bio->flags = 0; - bio->ptr = nullptr; + Data *data = new Data; --- End diff -- TBH, I am a bit confused by the original code. For example, why was `fastopen_create` called in `fastopen_destroy`? Then why did you remove that? It also seems like we were previously overloading these values in the `BIO` struct out of convenience, and maybe we can just use a pointer to an existing data structure? I'm not really familiar with how these BIO's were meant to be used before or not. It looks like @jpeach wrote this code originally so maybe it'd be good for him to review.
--- 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. ---