Fri 23 Feb 2007
Category : Technology/LeopardDevProg.txt
I've been having problems downloading the Leopard releases from Developer Connection. I kept getting disconnected before the downloads can finish.
I have two broadband lines coming into my home/office. One, the higher speed 3500 kbps line, kept getting disconnected at around the 559 MB point through the download. The other, a slower 512 kbps line, didn't have the same problem, but because it's a 5.1 GB install, it can take over 24 hours to download, and something or other would happen and I would always find the download either failed or timed-out when I next looked at it.
Now, I remember the last time we had a major OS X upgrade, moving from Panther to Tiger, I had the same problem. So I gave up downloading the developer releases after December, skipping the next two or so releases, thinking that things are not going to change much at the system-level going into the final release. I'd already seeded a few people with a Tiger-compatible version of Postfix Enabler and I hadn't gotten any feedback that anything was amiss. But that turned out to be almost a fatal mistake.
Thinking back, I wonder how I could have been so complacent. When Tiger was released, I relased Postfix Enabler on the same day, and the downloads (and payments) started coming in, seconds after I've updated my web site. A couple of hours later, I received this :
What happened was that Apple deprecated the use of xinetd in the release version of Tiger, though it was still there in my developer version. Everything now had to go through the launch daemons mechanism. Imagine, the money was pouring in (and I should be so happy), but some things weren't working and I hadn't a clue what was happening. If I couldn't solve it, I would have to return every one of those dollars. So I took the download link off with an apology that I'm working on a fix, drove through heavy downtown traffic to get a shrink-wrapped copy of Tiger, and spent the next seven hours debugging it. The story had a happy ending. Postfix Enabler was put back on-line, the downloads resumed (again, seconds after updating my web page and that was so amazing, and so did the money), and this had kept on going all the way till now, almost two years later (talk about a long tail).
But I'm not going to make the same mistake again. So I thought I was going to stop everything else I was working on to make sure I have a way to always download the latest developer releases, all the way to golden master (do they still call the final release that, or is this so 20th century?).
I've tried everything - Safari, iGetter, Firefox, CyberDuck - but nothing worked for me. I needed to know what was happening at the point of failure. So I cobbled together some code from the Developer Examples that came with Xcode (the Downloader and the MiniBrowser sample code). And the result is what you see in the picture above.
Look closely - it's not Safari. I've duplicated enough of the Safari features to get the downloads to work so I can trace what is happening when they fail. In the end I've found a solution. The downloads were failing at the (mysterious) 559 MB point if I don't use a proxy web server. If I use that ISP's proxy server, the downloads don't get cut off anymore.
So this should work also with Safari. It shouldn't now get cut off at 559 MB. But because I've concentrated on the download process, and every line of code has to do with download and nothing more, downloads using my version seem to run somewhat faster. I'm now able to download a Leopard release in about four hours. So that's a lot of improvement.
The application itself is not really much. You can download it from here.
But what I'd like to do, when I get the time, is to enhance it so that it can break the downloads into parts, like iGetter does. Plus a few other things.
I've said it many times. Cocoa is a wonderful software development platform. I've always wondered how Safari's downloads window works, Like how do you get the progress bar with those little round buttons and icon into a normal table view? Turns out that it only took a few lines of code. Totally amazing.
If I don't maintain some discipline I could go on forever into all these tangents. This is Disneyland for developers. But people have been asking about MailServe/Postfix Enabler/WebMon/DNS Enabler for Leopard. It's time to focus on the task at hand.