Skip to content

Commit

Permalink
Back out "fbcode/fboss/lib/oss"
Browse files Browse the repository at this point in the history
Summary:
Original commit changeset: 0f6a66b3c0b1

Original Phabricator Diff: D63823194

Used in OSS. I am working on having Dead Code Bot updated to stop making these types of changes https://fb.workplace.com/groups/dead.code.bot/permalink/1712404122870889/.

Reviewed By: srikrishnagopu

Differential Revision: D63909637

fbshipit-source-id: 944b2134d515f7353ae9f697131fa7928c688a43
  • Loading branch information
paulcruz74 authored and facebook-github-bot committed Oct 4, 2024
1 parent a85ebda commit 6048ffa
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions fboss/lib/oss/LogThriftCall.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2004-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/

#include "fboss/lib/LogThriftCall.h"

namespace facebook::fboss {

std::optional<std::string> LogThriftCall::getIdentityFromConnContext(
apache::thrift::Cpp2ConnContext* ctx) const {
if (ctx) {
// note that getPeerCommonName is not 100% reliable with certain
// protocols that may cache certificates at the transport layer.
auto identity = ctx->getPeerCommonName();
if (!identity.empty()) {
return identity;
}
}
return std::nullopt;
}

} // namespace facebook::fboss

0 comments on commit 6048ffa

Please sign in to comment.