Comment 1 for bug 184354

Revision history for this message
Gary Shi (garyshi) wrote :

This bug is a major problem for our situation. I'm from Shanghai Linux User Group of China, we're the maintainer of China's formal ubuntu mirror (cn.archive.ubuntu.com), and an important debian mirror (still not formal, but might be if we can overcome the bandwidth problem). But bandwidth is expensive here, and we SHLUG don't have a lot of money to buy enough bandwidth for whole China's ubuntu and debian user. So we're proposing a distributed architecture, to make use of idle bandwidth from servers of our friends/companies. We plan to serve meta files directly from our primary server, and forward request to deb packages to other servers with HTTP 302 reply. So we have to get this bug fixed.

I made a patch for apt-0.7.6ubuntu14.1 to handle this problem, it's a little tricky because:
1. the original code doesn't contain logic for redirection, so I added a redirection loop in HttpMethod::Loop;
2. the protocol between apt and methods/http requires the URI returned must be the same as the requested, so I have to cheat apt about the actual URI.

The patch also contains some debug info (to /tmp/apt-http.log), and the indentation is optimized for "diff" purpose.