Well, expect that 406 and Range have nothing to do with each other. 416 is an out-of-range request, while 406 tells us that we requested a file in a specific encoding which the server did not have.
The 416 Range thing should be handled for a while now, we at least have a testcase covering it so I would be interested in how to reproduce it still in apt versions >= 0.9.12 (disclaimer: I wrote both, the patch and the test).
[well, expect that as mentioned in #20 we would try to range a bz2 with an incomplete xz, but that could change with other reorganisations soon and more importantly, is pretty unlikely to have practical effect as compression formats do not appear and disappear at random from mirrors…]. A proper server shouldn't sent us a 416 here anyway, as we sent an If-Range btw as detailed in the HTTP RFC, but if we get it anyhow, we drop the partial file we have and do the request again without a range.
Regarding 406: We send an Accept header only if we request an uncompressed file (to prevent servers from content negotiating us a compressed file we do not support…), which is the last one we would try and usually doesn't exist (expect on your own localnet mirrors), so a failure is expected and the problem is more that your mirror doesn't have the compressed files we asked for before…
Well, expect that 406 and Range have nothing to do with each other. 416 is an out-of-range request, while 406 tells us that we requested a file in a specific encoding which the server did not have.
The 416 Range thing should be handled for a while now, we at least have a testcase covering it so I would be interested in how to reproduce it still in apt versions >= 0.9.12 (disclaimer: I wrote both, the patch and the test).
[well, expect that as mentioned in #20 we would try to range a bz2 with an incomplete xz, but that could change with other reorganisations soon and more importantly, is pretty unlikely to have practical effect as compression formats do not appear and disappear at random from mirrors…]. A proper server shouldn't sent us a 416 here anyway, as we sent an If-Range btw as detailed in the HTTP RFC, but if we get it anyhow, we drop the partial file we have and do the request again without a range.
Regarding 406: We send an Accept header only if we request an uncompressed file (to prevent servers from content negotiating us a compressed file we do not support…), which is the last one we would try and usually doesn't exist (expect on your own localnet mirrors), so a failure is expected and the problem is more that your mirror doesn't have the compressed files we asked for before…