Skip to content

Commit d9635ad

Browse files
committed
[net] deprecate T*Socket::SetSecContext()
1 parent 9bdbc51 commit d9635ad

5 files changed

Lines changed: 13 additions & 4 deletions

File tree

net/auth/src/TRootAuth.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ ROOT::Deprecated::TRootAuth::Authenticate(TSocket *s, const char *host, const ch
7676
} else {
7777
// Search pointer to relevant TSecContext
7878
ctx = auth->GetSecContext();
79-
s->SetSecContext(ctx);
79+
ROOT::Deprecated::TSocketFriend::SetSecContext(*s, ctx);
8080
}
8181
// Cleanup
8282
delete auth;

net/net/inc/TSocket.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class TSocket;
4040
namespace ROOT::Deprecated {
4141
struct TSocketFriend {
4242
static Bool_t IsAuthenticated(const TSocket &s);
43+
static void SetSecContext(TSocket &s, TSecContext *ctx);
4344
};
4445
} // namespace ROOT::Deprecated
4546

@@ -163,7 +164,9 @@ friend class ROOT::Deprecated::TSocketFriend;
163164
void SetCompressionSettings(Int_t settings = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault);
164165
virtual Int_t SetOption(ESockOptions opt, Int_t val);
165166
void SetRemoteProtocol(Int_t rproto) { fRemoteProtocol = rproto; }
166-
void SetSecContext(ROOT::Deprecated::TSecContext *ctx) { fSecContext = ctx; }
167+
void SetSecContext(ROOT::Deprecated::TSecContext *ctx)
168+
R__DEPRECATED(6, 42, "TSocket::SetSecContext is deprecated")
169+
{ ROOT::Deprecated::TSocketFriend::SetSecContext(*this, ctx); }
167170
void SetService(const char *service) { fService = service; }
168171
void SetServType(Int_t st) { fServType = (EServiceType)st; }
169172
void SetUrl(const char *url) { fUrl = url; }

net/net/inc/TUDPSocket.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ friend class TServerSocket;
135135
void SetCompressionSettings(Int_t settings = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault);
136136
virtual Int_t SetOption(ESockOptions opt, Int_t val);
137137
void SetRemoteProtocol(Int_t rproto) { fRemoteProtocol = rproto; }
138-
void SetSecContext(ROOT::Deprecated::TSecContext *ctx) { fSecContext = ctx; }
138+
void SetSecContext(ROOT::Deprecated::TSecContext *ctx)
139+
R__DEPRECATED(6, 42, "TUDPSocket::SetSecContext is deprecated"){ fSecContext = ctx; }
139140
void SetService(const char *service) { fService = service; }
140141
void SetServType(Int_t st) { fServType = (EServiceType)st; }
141142
void SetUrl(const char *url) { fUrl = url; }

net/net/src/TPServerSocket.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ TPSocket *TPServerSocket::Accept(UChar_t Opt)
137137

138138
// Transmit authentication information, if any
139139
if (ROOT::Deprecated::TSocketFriend::IsAuthenticated(*setupSocket))
140-
newPSocket->SetSecContext(setupSocket->GetSecContext());
140+
ROOT::Deprecated::TSocketFriend::SetSecContext(*newPSocket, setupSocket->GetSecContext());
141141

142142
// clean up, if needed
143143
if (size > 0)

net/net/src/TSocket.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ Bool_t ROOT::Deprecated::TSocketFriend::IsAuthenticated(const TSocket &s)
4141
return s.fSecContext;
4242
}
4343

44+
void ROOT::Deprecated::TSocketFriend::SetSecContext(TSocket &s, TSecContext *ctx)
45+
{
46+
s.fSecContext = ctx;
47+
}
48+
4449

4550
ULong64_t TSocket::fgBytesSent = 0;
4651
ULong64_t TSocket::fgBytesRecv = 0;

0 commit comments

Comments
 (0)