Skip to content

cloneProtoSet() does not actually clone things properly #5734

@zwoop

Description

@zwoop

In this code:

void
SNIConfig::cloneProtoSet()
{
  SCOPED_MUTEX_LOCK(lock, naVecMutex, this_ethread());
  for (auto na : naVec) {
    if (na->snpa) {
      auto snps = na->snpa->cloneProtoSet();
      snps->unregisterEndpoint(TS_ALPN_PROTOCOL_HTTP_2_0, nullptr);
      snpDisableH2Map.emplace(na->id, snps);
    }
  }
}

It turns out that the call to unregisterEndpoint() is essentially a no-op. The call to

auto snps = na->snpa->cloneProtoSet();

doesn't actually clone the H2 protocol handler. I.e. if I remove the unregisterEndpoint() call completely, the code still works exactly as "intended". However, this is why I can't get the new feature to turn on H2 to work, because the clone mechanism here is not working.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions