The unpack in parseHeader should use 'L' instead of 'l' for the format. Those values are unsigned. It doesn't work on my server without that change.