candlepin/thumbslug — pull request #17 by jbowes (2012-11-07 17:33:00+00:00)
Title: 817599: Fix closing connections when in a bad state

This patch implements a number of changes to close out our three
possible connections (client, candlepin, cdn) properly, and to ensure
the correct message reaches the client for a thumbslug/candlepin
misconfiguration.

The primary change is to add a listener for closed connections to the
client, and to have that listener close down any open connections to
candlepin or the cdn. With this listener in place, we just have to close
the client connection whenever something bad happens when talking to
candlepin or the cdn.