void ConnectOperation::maybeStoreSSLSession()

in squangle/mysql_client/Operation.cpp [825:843]


void ConnectOperation::maybeStoreSSLSession() {
  // if there is an ssl provider set
  auto provider = conn_options_.getSSLOptionsProviderPtr();
  if (!provider) {
    return;
  }

  // If connection was successful
  if (result_ != OperationResult::Succeeded || !conn()->hasInitialized()) {
    return;
  }

  if (provider->storeMysqlSSLSession(conn()->mysql())) {
    if (connection_context_) {
      connection_context_->sslSessionReused = true;
    }
    client()->stats()->incrReusedSSLSessions();
  }
}