- if self.parent.parent.cfg.getboolean('debug', 'io'):
- self.parent.log('O', line)
- self.bytessent += len(line)
- try:
- self._write(line)
- except socket.error as e:
- self.parent._goterror(repr(e))
+ if not self._nowrite:
+ if self.parent.parent.cfg.getboolean('debug', 'io'):
+ self.parent.log('O', line)
+ self.bytessent += len(line)
+ try:
+ self._write(line)
+ except socket.error as e:
+ self._nowrite = True
+ self.parent._goterror(repr(e))
+ else:
+ if self.parent.parent.cfg.getboolean('debug', 'io'):
+ self.parent.log('X', line)