Skip to content

Commit

Permalink
Added support for abandon request
Browse files Browse the repository at this point in the history
Conflicts:
	ldaptor/test/test_pureldap.py
  • Loading branch information
norox authored and psi29a committed Jul 4, 2014
1 parent 7373396 commit 7890f4c
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions ldaptor/protocols/pureldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def escape(s):
s = s.replace('\0', r'\00')
return s

class LDAPInteger(BERInteger):
pass

class LDAPString(BEROctetString):
pass

Expand Down Expand Up @@ -1137,9 +1140,33 @@ class LDAPModifyDNResponse(LDAPResult):

#class LDAPCompareResponse(LDAPProtocolResponse):
#class LDAPCompareRequest(LDAPProtocolRequest):
#class LDAPAbandonRequest(LDAPProtocolRequest):
# needs_answer=0

class LDAPAbandonRequest(LDAPProtocolRequest, LDAPInteger):
tag = CLASS_APPLICATION|0x10
needs_answer=0

def __init__(self, value=None, id=None, tag=None):
"""
Initialize the object
l=LDAPAbandonRequest(id=1)
"""
if id is None and value is not None:
id = value
LDAPProtocolRequest.__init__(self)
LDAPInteger.__init__(self, value=id, tag=tag)

def __str__(self):
return LDAPInteger.__str__(self)

def __repr__(self):
if self.tag==self.__class__.tag:
return self.__class__.__name__+"(id=%s)" \
%repr(self.value)
else:
return self.__class__.__name__ \
+"(id=%s, tag=%d)" \
%(repr(self.value), self.tag)

class LDAPOID(BEROctetString):
pass
Expand Down Expand Up @@ -1347,4 +1374,5 @@ class LDAPBERDecoderContext(BERDecoderContext):
LDAPExtendedResponse.tag: LDAPExtendedResponse,
LDAPModifyDNRequest.tag: LDAPModifyDNRequest,
LDAPModifyDNResponse.tag: LDAPModifyDNResponse,
LDAPAbandonRequest.tag: LDAPAbandonRequest,
}

0 comments on commit 7890f4c

Please sign in to comment.