You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2010/02/09 12:17:26 UTC

New Bind and pending operations question

Hi,

when the client issue a first BindRequest, the messageId will be '1'. It 
will start a new LdapSession on the server, with all the subsequent 
operations having an incremented messageId. The clinet is responsible 
for the ID generation.

Now, if the client issue a new BindRequest, should the messageId be 
incremented, or reset to 1 ? My understanding is that we are stil in the 
same LdapSession, with a request for new credentials, and we then need 
to use an incremented ID.

For instance, in this scenario, where the ID is in parentheses after the 
request :
Bind(1)
Search(2)
Search(3)
Bind(XXX)

the XXX should be 4.

Now, that raise another question : whet should we do with the responses 
to (3), assuming we haven't received all of it ? Should we discard them 
? My understanding is that they are still valid.

wdyt ?

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com



Re: New Bind and pending operations question

Posted by Howard Chu <hy...@symas.com>.
Emmanuel Lecharny wrote:
> Hi,
>
> when the client issue a first BindRequest, the messageId will be '1'. It
> will start a new LdapSession on the server, with all the subsequent
> operations having an incremented messageId. The clinet is responsible
> for the ID generation.
>
> Now, if the client issue a new BindRequest, should the messageId be
> incremented, or reset to 1 ? My understanding is that we are stil in the
> same LdapSession, with a request for new credentials, and we then need
> to use an incremented ID.

Agreed, that's what we do. RFC4511 section 4.1.1.1 says the messageID must not 
be reused within an LDAP session.

> For instance, in this scenario, where the ID is in parentheses after the
> request :
> Bind(1)
> Search(2)
> Search(3)
> Bind(XXX)
>
> the XXX should be 4.
>
> Now, that raise another question : whet should we do with the responses
> to (3), assuming we haven't received all of it ? Should we discard them
> ? My understanding is that they are still valid.

This is spelled out in RFC4511 section 4.2.1.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Re: New Bind and pending operations question

Posted by Alex Karasulu <ak...@gmail.com>.
On Tue, Feb 9, 2010 at 6:17 AM, Emmanuel Lecharny <el...@gmail.com>wrote:

> Hi,
>
> when the client issue a first BindRequest, the messageId will be '1'. It
> will start a new LdapSession on the server, with all the subsequent
> operations having an incremented messageId. The clinet is responsible for
> the ID generation.
>
> Now, if the client issue a new BindRequest, should the messageId be
> incremented, or reset to 1 ? My understanding is that we are stil in the
> same LdapSession, with a request for new credentials, and we then need to
> use an incremented ID.
>
> For instance, in this scenario, where the ID is in parentheses after the
> request :
> Bind(1)
> Search(2)
> Search(3)
> Bind(XXX)
>
> the XXX should be 4.
>
> Now, that raise another question : whet should we do with the responses to
> (3), assuming we haven't received all of it ? Should we discard them ? My
> understanding is that they are still valid.
>
> wdyt ?
>
> The values for the message ID are specific to the session established with
the bind not with the connection. So we would start again from 1.  In a way
note that the session:messageId uniquely identifies each message received by
the server - although this is not explicit with a session id there is a
unique LdapSession object created.

So a new LdapSession object needs to be created for the new bind request
that comes in and numbers need to start back at 1. They can start at 4 too
if you like but this is not necessary, you just don't view 1 2 and 3 as
value usable message ID values for that session.

Now in terms of outstanding operations that are still in progress you need
to abandon or cancel them programatically once there is an explicit
UnbindRequest or there is an implicit unbind with a RE-BindRequest using the
same TCP socket.

Does this make sense or am I missing something.

-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org

Re: New Bind and pending operations question

Posted by Kiran Ayyagari <ay...@gmail.com>.

Emmanuel Lecharny wrote:
> Hi,
> 
> when the client issue a first BindRequest, the messageId will be '1'. It 
> will start a new LdapSession on the server, with all the subsequent 
> operations having an incremented messageId. The clinet is responsible 
> for the ID generation.
> 
> Now, if the client issue a new BindRequest, should the messageId be 
> incremented, or reset to 1 ? My understanding is that we are stil in the 
> same LdapSession, 

am a bit confused about the semantics of this 'LdapSession',
AFAIU, I treat one LdapSession is associated with a one successful bind.

I might sound stupid, but this is a q I have,
If we perform multiple binds on an already bound session then to which session the server associates
the incoming requests? (my thinking is that that will be the last successfully bound session)

Kiran Ayyagari