@@ -545,23 +545,29 @@ } return ret; } -- (void)stream: (OF_KINDOF(OFStream *))sock - didFailWithException: (id)exception +- (void)stream: (OF_KINDOF(OFStream *))sock + didFailToReadWithException: (id)exception +{ + if ([exception isKindOfClass: [OFInvalidEncodingException class]]) + exception = [OFInvalidServerReplyException exception]; + + [self raiseException: exception]; +} + +- (void)stream: (OF_KINDOF(OFStream *))sock + didFailToWriteWithException: (id)exception { if ([exception isKindOfClass: [OFWriteFailedException class]] && ([exception errNo] == ECONNRESET || [exception errNo] == EPIPE)) { /* In case a keep-alive connection timed out */ [self closeAndReconnect]; return; } - if ([exception isKindOfClass: [OFInvalidEncodingException class]]) - exception = [OFInvalidServerReplyException exception]; - [self raiseException: exception]; } - (size_t)stream: (OF_KINDOF(OFStream *))sock didWriteBuffer: (const void **)request