That is much fewer LoC than I expected.

How is "offline e-reader" handled? Does CUPS retry?

Do you do this outside of your LAN?