code: def connectionLost(self, reason):
          
          self.setTimeout(None)
          if reason.check(ResponseDone, PotentialDataLoss):
              self.deferred.callback(None)
          else:
              self.deferred.errback(reason)
docs: Called when the body is complete or the connection was lost.
  
          @note: As the body length is usually not known at the beginning of the
          response we expect a L{PotentialDataLoss} when Twitter closes the
          stream, instead of L{ResponseDone}. Other exceptions are treated
          as error conditions.