HenningSchroeder / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

repo sync crashes if server doesn't set content-length header #96

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Affected Version: 1.13
Environment: Behind corporate proxy

I ran into this issue when using `repo sync` on a new `repo init`.

Specifically, the 'devices/samsung/tuna/clone.bundle' download is causing 
issues.  The file is rather large, over 600 MB.  For some reason, the redirect 
that is actually backing the file doesn't return a Content-Length header, and 
subsequently, the repo script crashes and there is no way to finish the sync.  
The problem is repeatable as well.

I have attached a patch that I used to work around the issue, but it is not a 
final solution.  The code attached will only set the size if the 
'content-length' key exists in the headers map of the response of the HTTP 
request.  This means that if the server doesn't set 'Content-Length', then 
there will be no progress of the download printed.  Perhaps this is actually 
OK, but I would argue that providing feedback to the user is most important 
when there is a large file like this, and a progress with unknown status should 
be displayed instead.

Original issue reported on code.google.com by ReKl...@gmail.com on 18 Nov 2011 at 10:02

GoogleCodeExporter commented 8 years ago
Hi,

I am also experiencing this problem, however the patch you attached is 0 bytes, 
could you please reattach it, as I would like to see if this is really the 
problem..

Original comment by mwsea...@gmail.com on 9 Dec 2011 at 8:15

GoogleCodeExporter commented 8 years ago
Attached are the changes I currently have.  I'm not certain if this is the same 
as what was originally attached, but it is how I left the repo after getting 
things to work, so I think it's safe to assume it is.

Original comment by ReKl...@gmail.com on 12 Dec 2011 at 10:35

Attachments:

GoogleCodeExporter commented 8 years ago
That fixes everything here it looks like, simple yet effective :)

Original comment by n...@genesi-usa.com on 16 Dec 2011 at 10:32