Ah, right. I didn't notice the token to be decoded should be passed TWO times 
(though not very natural to me). Thanks Emmanule!

        ApReqContainer apreqContainer = new 
ApReqContainer(apreqToken.duplicate());
        krbDecoder.decode(apreqToken, apreqContainer);

Regards,
Kai

-----Original Message-----
From: Emmanuel Lécharny [mailto:[email protected]] 
Sent: Monday, July 20, 2015 1:02 PM
To: [email protected]
Subject: Re: Kerby benchmark issue related to ApacheDS

Le 20/07/15 05:58, Zheng, Kai a écrit :
> Hi Emmanuel or all,
>
> I'm working on Kerby benchmark and just converted existing benchmark tests to 
> use JMH micro benchmark framework. A test related to ApacheDS failed as below 
> and I'm wondering if there're some concurrency issue in the codes. Would you 
> take a look at it if you're convenient? Thanks.

There is a mistake in your test.

When you do :

        ApReqContainer apreqContainer = new 
ApReqContainer(apreqToken.duplicate());

you inject a different stream in the container than teh one you will decode. 
When the codec will try to decode the inner ticket, it will use this duplicated 
stream, which will start at position 0, as the stream is duplicated, when it's 
expected to be at position 25, as the original stream has already been 
partially decoded.

What you should do is :

        ApReqContainer apreqContainer = new ApReqContainer(apreqToken);

Now, be sure to do a apreqToken.flip(); at the end of your test, otherwise you 
won't be able to run it more than once

Reply via email to