AFNetworking/AFNetworking — pull request #972 by aburgel (2013-05-06 17:32:51+00:00)
Title: Register error if new bodyStream cannot be created

It looks like #819 broke #718 because the input stream created no longer implements NSCopying. This patch doesn't fix that, but it does cause the connection to close gracefully when needNewBodyStream returns nil.

According to the [NSURLConnectionDelegate docs](http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate), returning nil from `needNewBodyStream` causes the connection to fail, but this does not trigger any of AFNetworking's error handling or callbacks. So this patch adds those back in.

I used `NSURLErrorCancelled` for the error, but maybe there's a more appropriate code?