Skip to content

Commit 86b19a5

Browse files
author
fabienbancharel
committed
For thread safety, define gssContext, token, negotiationOid as local variables instead of class attributes. (gssContext must not be thread safe as it makes NPE under load)
1 parent bb2a7bb commit 86b19a5

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/main/java/com/ning/http/client/providers/netty/spnego/SpnegoEngine.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,6 @@ public class SpnegoEngine {
6262

6363
private final SpnegoTokenGenerator spnegoGenerator;
6464

65-
private GSSContext gssContext = null;
66-
67-
/**
68-
* base64 decoded challenge *
69-
*/
70-
private byte[] token;
71-
72-
private Oid negotiationOid = null;
73-
7465
public SpnegoEngine(final SpnegoTokenGenerator spnegoGenerator) {
7566
this.spnegoGenerator = spnegoGenerator;
7667
}
@@ -80,6 +71,9 @@ public SpnegoEngine() {
8071
}
8172

8273
public String generateToken(String server) throws Throwable {
74+
GSSContext gssContext = null;
75+
byte[] token = null; // base64 decoded challenge
76+
Oid negotiationOid = null;
8377

8478
try {
8579
log.debug("init {}", server);

0 commit comments

Comments
 (0)