Skip to content

Transports and custom data #2790

@alexcrichton

Description

@alexcrichton

I've been tackling a few things with custom transports recently, and I've run into a few issues here and there:

  • When I call git_transport_register, I hand off my void*, but there doesn't seem to be a point where I get it back? If it is an allocated block it's tough to free it at some point unless I store it personally and free it after a call to git_transport_unregister.

    One concrete instance of this issue is that when using git_smart_subtransport_definition, if it's an allocated block, it's tough to get it back out to deallocate it.

  • When using git_smart_subtransport_definition, there's no way to provide custom data to the stored git_smart_subtransport_cb. This is the same as git_transport_register smart subtransport with custom payload #2500, but it seems that it was closed with no resolution?

I would personally be looking for something along the lines of:

  • git_transport_unregister takes a *mut *mut c_void parameter (optionally NULL) which receives the data pointer of the unregistered callback.
  • git_smart_subtransport_definition gains a free callback like the other git_smart structures.
  • git_smart_subtransport_cb also receives the git_smart_subtransport_definition as an argument.

All that being said, I may have missed something!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions