FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Added 'refList' as a list containing all referrals returned from server. by nickfolino · Pull Request #459 · python-ldap/python-ldap · GitHub

Added 'refList' as a list containing all referrals returned from server. - #459

Open
nickfolino wants to merge 1 commit into
python-ldap:mainfrom
nickfolino:referral_br
Open

Added 'refList' as a list containing all referrals returned from server.#459
nickfolino wants to merge 1 commit into
python-ldap:mainfrom
nickfolino:referral_br

Conversation

Copy link
Copy Markdown

Added a refList that contains all referrals returned from the server.
Still maintains the first referral in 'info'.

tiran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Every Python API call requires an explicit error check.

Please also include documentation update and test cases.

Comment thread Modules/constants.c

if (errnum == LDAP_REFERRAL && refs != NULL && refs[0] != NULL) {
/* Return all referrals as a list in "reflist" */
PyObject *referralList = PyList_New(0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Missing error check.

Comment thread Modules/constants.c
PyObject *referralList = PyList_New(0);
int i = 0;
while (refs[i] != NULL) {
PyObject *referralURL = Py_BuildValue("s", refs[i++]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Use PyUnicode_FromString() and check for error (NULL).

Comment thread Modules/constants.c
int i = 0;
while (refs[i] != NULL) {
PyObject *referralURL = Py_BuildValue("s", refs[i++]);
PyList_Append(referralList, referralURL);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Missing error check.

Comment thread Modules/constants.c
PyList_Append(referralList, referralURL);
Py_XDECREF(referralURL);
}
PyDict_SetItemString(info, "reflist", referralList);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Missing error check

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL