Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose fcts and fix string conversion #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jecaro
Copy link

@jecaro jecaro commented Mar 15, 2022

I need to start a LDAP session with an already open socket. So I exposed those two additional C functions: ldap_init_fd and ldap_install_tls.

Also in my tests, I found out that some bytes were missing in a field I need. It's a string conversion issue. I fix it in a6a27f3. The commit contains additional information about the issue.

jecaro added 3 commits March 9, 2022 17:45
peekCStringLen uses the local encoding to convert the bytes to an
Haskell String. This can result in bytes dropped by the conversion if
the sequence of bytes is not interpretable in the current encoding.

We should actually use ByteString here as the value is not necessarily a
String.

Using the version peekCAStringLen ensures all the actual bytes end up
in the Haskell String. Then one can convert it to a ByteString with
Data.ByteString.Char8
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.

1 participant