Skip to content

getInfo mishandles 'Private' info type #6

Description

@iustin

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions