Skip to content

smart transport: only clear url on hard reset (regression)#4880

Merged
ethomson merged 1 commit intomasterfrom
ethomson/smart_transport_url
Nov 10, 2018
Merged

smart transport: only clear url on hard reset (regression)#4880
ethomson merged 1 commit intomasterfrom
ethomson/smart_transport_url

Conversation

@ethomson
Copy link
Copy Markdown
Member

@ethomson ethomson commented Nov 7, 2018

After creating a transport for a server, we expect to be able to call
connect, then invoke subsequent action calls. We provide the URL to
these action calls, although our built-in transports happen to ignore
it since they've already parsed it into an internal format that they
intend to use (gitno_connection_data).

In ca2eb46, we began clearing the URL
field after a connection, meaning that subsequent calls to transport
action callbacks would get a NULL URL, which went undetected since the
builtin transports ignore the URL when they're already connected
(instead of re-parsing it into an internal format).

Downstream custom transport implementations (eg, LibGit2Sharp) did
notice this change, however.

Since reset_stream is called even when we're not closing the
subtransport, update to only clear the URL when we're closing the
subtransport. This ensures that action calls will get the correct URL
information even after a connection.

After creating a transport for a server, we expect to be able to call
`connect`, then invoke subsequent `action` calls.  We provide the URL to
these `action` calls, although our built-in transports happen to ignore
it since they've already parsed it into an internal format that they
intend to use (`gitno_connection_data`).

In ca2eb46, we began clearing the URL
field after a connection, meaning that subsequent calls to transport
`action` callbacks would get a NULL URL, which went undetected since the
builtin transports ignore the URL when they're already connected
(instead of re-parsing it into an internal format).

Downstream custom transport implementations (eg, LibGit2Sharp) did
notice this change, however.

Since `reset_stream` is called even when we're not closing the
subtransport, update to only clear the URL when we're closing the
subtransport.  This ensures that `action` calls will get the correct URL
information even after a connection.
@ethomson
Copy link
Copy Markdown
Member Author

ethomson commented Nov 7, 2018

Confirmed that this fixes the issue in LibGit2Sharp when using its own transports.

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