* Replaces the current SSLNetVConnection with a UnixNetVConnection * Propagates any data in the SSL handShakeBuffer to be processed * by the UnixNetVConnection logic */
| 1994 | * by the UnixNetVConnection logic |
| 1995 | */ |
| 1996 | UnixNetVConnection * |
| 1997 | SSLNetVConnection::_migrateFromSSL() |
| 1998 | { |
| 1999 | EThread *t = this_ethread(); |
| 2000 | NetHandler *client_nh = get_NetHandler(t); |
| 2001 | ink_assert(client_nh); |
| 2002 | |
| 2003 | Connection hold_con; |
| 2004 | hold_con.move(this->con); |
| 2005 | |
| 2006 | // We will leave the SSL object with the original SSLNetVC to be |
| 2007 | // cleaned up. Only moving the socket and handShakeBuffer |
| 2008 | // So no need to call _prepareMigration |
| 2009 | |
| 2010 | // Do_io_close will signal the VC to be freed on the original thread |
| 2011 | // Since we moved the con context, the fd will not be closed |
| 2012 | // Go ahead and remove the fd from the original thread's epoll structure, so it is not |
| 2013 | // processed on two threads simultaneously |
| 2014 | this->ep.stop(); |
| 2015 | |
| 2016 | // Create new VC: |
| 2017 | UnixNetVConnection *newvc = static_cast<UnixNetVConnection *>(unix_netProcessor.allocate_vc(t)); |
| 2018 | ink_assert(newvc != nullptr); |
| 2019 | if (newvc != nullptr && newvc->populate(hold_con, this->read.vio.cont, nullptr) != EVENT_DONE) { |
| 2020 | newvc->do_io_close(); |
| 2021 | Dbg(dbg_ctl_ssl, "Failed to populate unixvc for allow-plain"); |
| 2022 | newvc = nullptr; |
| 2023 | } |
| 2024 | if (newvc != nullptr) { |
| 2025 | newvc->attributes = HttpProxyPort::TRANSPORT_DEFAULT; |
| 2026 | newvc->set_is_transparent(this->is_transparent); |
| 2027 | newvc->set_context(get_context()); |
| 2028 | newvc->options = this->options; |
| 2029 | Dbg(dbg_ctl_ssl, "Move to unixvc for allow-plain"); |
| 2030 | this->_propagateHandShakeBuffer(newvc, t); |
| 2031 | } |
| 2032 | |
| 2033 | // Do not mark this closed until the end so it does not get freed by the other thread too soon |
| 2034 | this->do_io_close(); |
| 2035 | return newvc; |
| 2036 | } |
| 2037 | |
| 2038 | ssl_curve_id |
| 2039 | SSLNetVConnection::_get_tls_curve() const |
no test coverage detected