Skip to content

Handle cases where content length of an http response is zero #7024

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lrm29
Copy link
Contributor

@lrm29 lrm29 commented Jan 20, 2025

Closes #7090
Closes #7070

@ethomson
Copy link
Member

Hey @lrm29 - curious if this is ready for review? Is there anything that I can help with?

@lrm29 lrm29 marked this pull request as ready for review February 26, 2025 19:20
@lrm29
Copy link
Contributor Author

lrm29 commented Feb 26, 2025

Sorry, yes, I'm using this patch and think I would have heard of problems by now... I'm wary of not having test coverage for this in libgit2 itself (would be nice to be able to mock the server to be able to test the logic, rather than having to add a new test server).

It's clearly unusual to receive empty responses. It seems to be quite particular to a test Git server I've got running in a docker container, and tests against that pass with this patch.

There's more description of the issue in #7013.

@ethomson
Copy link
Member

Thanks! Wanted to check in because I've been ignoring it since it was marked as draft but it also looks correct and complete. I'll pull it in to a v1.9.1.

@nadavhaik
Copy link

Hi, when will this fix be reflected in pygit2?

@lrm29
Copy link
Contributor Author

lrm29 commented Jun 23, 2025

@ethomson, would be good to get this merged in if it passes review, seems to be more common than I originally thought.

@sdroege
Copy link

sdroege commented Jun 25, 2025

seems to be more common than I originally thought

Specifically, it affects all redirects from gitlab, both self-hosted as well as on gitlab.com.

I can confirm that this PR solves the problem.

EDIT: Specifically gitlab 18 is changing the behaviour to return an empty body, earlier versions had a little piece of HTML as response body

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.

Massive libgit2 performance regression observed in Kubuntu 25.04 and Windows 11 Redirect with an empty body causes infinite hang
4 participants