summaryrefslogtreecommitdiff
path: root/src/mongo/transport/session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/transport/session.cpp')
-rw-r--r--src/mongo/transport/session.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mongo/transport/session.cpp b/src/mongo/transport/session.cpp
index b9f382a6965..ebf237f8bd4 100644
--- a/src/mongo/transport/session.cpp
+++ b/src/mongo/transport/session.cpp
@@ -43,11 +43,14 @@ AtomicUInt64 sessionIdCounter(0);
} // namespace
Session::Session(HostAndPort remote, HostAndPort local, TransportLayer* tl)
- : _id(sessionIdCounter.addAndFetch(1)), _remote(remote), _local(local), _tl(tl) {}
+ : _id(sessionIdCounter.addAndFetch(1)),
+ _remote(std::move(remote)),
+ _local(std::move(local)),
+ _tags(kEmptyTagMask),
+ _tl(tl) {}
Session::~Session() {
if (_tl != nullptr) {
- invariant(_tl);
_tl->end(*this);
}
}
@@ -75,16 +78,21 @@ Session& Session::operator=(Session&& other) {
return *this;
}
-Session::SessionId Session::id() const {
- return _id;
+void Session::replaceTags(TagMask tags) {
+ _tags = tags;
+ _tl->registerTags(*this);
}
-const HostAndPort& Session::remote() const {
- return _remote;
+Ticket Session::sourceMessage(Message* message, Date_t expiration) {
+ return _tl->sourceMessage(*this, message, expiration);
}
-const HostAndPort& Session::local() const {
- return _local;
+Ticket Session::sinkMessage(const Message& message, Date_t expiration) {
+ return _tl->sinkMessage(*this, message, expiration);
+}
+
+std::string Session::getX509SubjectName() const {
+ return _tl->getX509SubjectName(*this);
}
} // namespace transport