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

Consistent indefinite hanging on remote connection #1140

Open
eighty4 opened this issue Mar 7, 2025 · 0 comments
Open

Consistent indefinite hanging on remote connection #1140

eighty4 opened this issue Mar 7, 2025 · 0 comments

Comments

@eighty4
Copy link

eighty4 commented Mar 7, 2025

git2-rs is blocking on RemoteConnection over cafe WiFi but works fine on my home network. Sometimes this happens with git when I'm on a public WiFi so I checked and git will pull or clone with SSH over the same network. Is there a configuration piece missing I overlooked? I see RemoteCallacks has proxy config and cert checks in addition to the credentials callback I'm using.

The program works great when the connection doesn't hang indefinitely. Here's an excerpt of where it hangs and here is the complete example.

fn pull() {
    let mut remote_connection =
        remote.connect_auth(Direction::Fetch, Some(remote_auth_callbacks()), None)?;
}

fn remote_auth_callbacks<'a>() -> RemoteCallbacks<'a> {
    let mut remote_callbacks = git2::RemoteCallbacks::new();
    remote_callbacks
        .credentials(|_, username, _| git2::Cred::ssh_key_from_agent(username.unwrap()));
    remote_callbacks
}

Thank you for the great examples in this crate. It helped me put together my work smoothly!

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

1 participant