Skip to content

Commit a58282a

Browse files
quanahmistotebe
authored andcommitted
Fixes python-ldap#565 - Use name values instead of raw decimal
Use the name values for result types in syncrepl.py rather than the raw decimal values. Signed-off-by: Quanah Gibson-Mount <quanah@openldap.org>
1 parent 06fdd3d commit a58282a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/ldap/syncrepl.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from ldap.pkginfo import __version__, __author__, __license__
1414
from ldap.controls import RequestControl, ResponseControl, KNOWN_RESPONSE_CONTROLS
15+
from ldap import RES_SEARCH_RESULT, RES_SEARCH_ENTRY, RES_INTERMEDIATE
1516

1617
__all__ = [
1718
'SyncreplConsumer',
@@ -407,7 +408,7 @@ def syncrepl_poll(self, msgid=-1, timeout=None, all=0):
407408
all=0,
408409
)
409410

410-
if type == 101:
411+
if type == RES_SEARCH_RESULT:
411412
# search result. This marks the end of a refreshOnly session.
412413
# look for a SyncDone control, save the cookie, and if necessary
413414
# delete non-present entries.
@@ -420,7 +421,7 @@ def syncrepl_poll(self, msgid=-1, timeout=None, all=0):
420421

421422
return False
422423

423-
elif type == 100:
424+
elif type == RES_SEARCH_ENTRY:
424425
# search entry with associated SyncState control
425426
for m in msg:
426427
dn, attrs, ctrls = m
@@ -439,7 +440,7 @@ def syncrepl_poll(self, msgid=-1, timeout=None, all=0):
439440
self.syncrepl_set_cookie(c.cookie)
440441
break
441442

442-
elif type == 121:
443+
elif type == RES_INTERMEDIATE:
443444
# Intermediate message. If it is a SyncInfoMessage, parse it
444445
for m in msg:
445446
rname, resp, ctrls = m

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy