AFNetworking/AFNetworking — pull request #1044 by mattt (2013-05-31 20:57:43+00:00)
Title: Revert Multipart Form Stream Provider

There have been several bug reports about the multipart stream provider, introduced in in 1.2.0, breaking multipart form streaming (see discussion in #948). Despite the best efforts of several contributors, a consistent fix for the reported bugs has not yet been found.

The multipart stream provider refactor in 1.2.0 was spearheaded by @mikeash as a way to avoid the hacky business of providing necessary implementations for private / undocumented `CFReadStream` bridged methods (e.g. `_scheduleInCFRunLoop:forMode:`). Unfortunately—and to no fault of @mikeash, whose contribution was otherwise excellent—there appear to be several underlying bugs in CFNetwork which cause inconsistent and difficult-to-pinpoint errors.

As @blakewatters was correct to point out, it's wrong for two of the most significant open source Objective-C libraries (AFN and RestKit, which depends on it), to be broken for academic reasons. Therefore, with this pull request, I propose that we revert back to the 1.1.0 `NSInputStream` subclass approach, which has proven to work consistently.

If anyone has any compelling reasons why this shouldn't be done, please say so. Otherwise, what I'm waiting for is confirmation from the participants in #948 (/cc @ExtremeMan, @blakewatters, @mattyohe, @JD-) that this indeed works.

I'd love to merge this as part of the 1.3.0 tag, which already includes API-breaking changes for SSL pinning.