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

getInfo mishandles 'Private' info type #6

Open
iustin opened this issue Feb 18, 2013 · 1 comment
Open

getInfo mishandles 'Private' info type #6

iustin opened this issue Feb 18, 2013 · 1 comment

Comments

@iustin
Copy link
Contributor

iustin commented Feb 18, 2013

This is how getInfo behaves for Private:

getInfo h i = do
 case i of
    
  Private -> getInfoStr h (show i) 21

However, the private pointer is a void* pointer, even though the C library handles it as a char* pointer. From the docs:

Please note that for internal reasons, the value is returned as a char pointer, although effectively being a 'void *'. (Added in 7.10.3)

This is also visible in the fact that for set_opt, CurlPrivate takes a Ptr () argument.

Adding a proper return type of Ptr () should be easy, with the note that life of the pointer will then have to be handled manually by the user of the library.

@glguy
Copy link
Member

glguy commented Feb 18, 2013

It looks like you're right. If you want to submit a pull request to fix this I can merge it in.

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

No branches or pull requests

2 participants