@@ -524,10 +524,17 @@ didWriteBody: (const void **)body length: (size_t)length context: (id)context exception: (id)exception { + if (exception != nil) { + [_client->_delegate client: _client + didEncounterException: exception + forRequest: _request]; + return 0; + } + [socket asyncReadLineWithTarget: self selector: @selector(socket:didReadLine:context: exception:) context: nil]; return 0; @@ -551,11 +558,11 @@ } [_client->_delegate client: _client didEncounterException: exception forRequest: _request]; - return false; + return 0; } if ((body = [_request body]) != nil) { [socket asyncWriteBuffer: [body items] length: [body count] * [body itemSize]