Fix a bug where [AFURLConnectionOperation cancel] does not set the appropriate error on the NSOperation.
Fix a bug where [AFURLConnectionOperation cancel] does not set the
appropriate error on the NSOperation.

There is a race condition where 'cancel' is called immediately after
'start'. When operationDidStart is then called on the Network Thread,
self.connection is not instantiated, because the NSOperation is
cancelled, and 'finish' is called, but without the error set.  When
cancelConnection is then called on the Network Thread, the error is not
set, because the operation is already finished.

In the new code, cancelConnection is always responsible for setting the error,
and then calling 'finish'. operationDidStart never attempts to call
'finish'.

This bug was one of the sources of non-deterministic failures in
testThatCancellationOfRequestOperationInvokesFailureCompletionBlock.

Kjuly/AFNetworking,wenjulike/AFNetworking,TornadoBack/AFNetworking,G-P-S/AFNetworking,fanwenkai/AFNetworking,Rdxer/AFNetworking,benzhipeng/AFNetworking,zhangnt/AFNetworking,Kevin775263419/AFNetworking,yunzhongyoulong/AFNetworking,zhouwude/AFNetworking,sujianping/AFNetworking,E-B-Smith/AFNetworking,lukw00/AFNetworking,ALICEDYY/AFNetworking,tesla4321/AFNetworking,comcxx11/AFNetworking,chenruixuan/AFNetworking,roximity/AFNetworking,baitxaps/AFNetworking,zhang-yawei/AFNetworking,yytong/AFNetworking,GuanKunLuo/AFNetworking,GHeminghui/AFNetworking,bhlzlx/AFNetworking,ArthurKK/AFNetworking,balaprasanna/AFNetworking,nonoBruce/AFNetworking,EGul/AFNetworking,yifili09/AFNetworking,Kjuly/AFNetworking,maximmalygin/AFNetworking,luwu121/AFNetworking,dearmushroom/AFNetworking,sdesimone/AFHPNetworking,j364960953/AFNetworking,CrowdTunes/AFNetworking,smule/AFNetworking,orta/AFNetworking,malandiwang/AFNetworking,SeanXiao90/AFNetworking,mashixiong/AFNetworking,iOSHome/AFNetworking,Fitbit/AFNetworking,10000TB/AFNetworking,harlanhaskins/AFNetworking,hyperoslo/AFNetworking,hj3938/AFNetworking,blueghost56/AFNetworking,koknine/AFNetworking,Instapaper/AFNetworking,ramoslin02/AFNetworking,weiqiangqi/AFNetworking,dx285/AFNetworking,JoshuaG11/Proyectos,flightaware/AFNetworking,lllito/AFNetworking,icepy/AFNetworking,GaryJuan/AFNetworking,sdesimone/AFHPNetworking,AFNetworking/AFNetworking,zhang-yawei/AFNetworking,dayup317165264/AFNetworking,smule/AFNetworking,mhpavl/AFNetworking,quyixia/AFNetworking,XcodeTalk/AFNetworking,Yincongxiao/AFNetworking,leelili/AFNetworking,vstrecher/AFNetworking,chenhaoheart/AFNetworking,wymsee/AFNetworking,StoneLeon/AFNetworking,wprice/AFNetworking,fbernaly/AFNetworking,hutuxianren/AFNetworking,christophercotton/AFNetworking,FredericJacobs/AFNetworking,mpatelCAS/AFNetworking,809848367/AFNetworking,perceptual/AFNetwerkin,pronebird/AFNetworking,BenjaminSarkisyan/AFNetworking,houweilei/AFNetworking,liuchenrc/AFNetworking,shoobs/AFNetworking-GRG,mobitar/AFNetworking,SecuraSeal/AFNetworking,caoer/AFNetworking,LYChow/AFNetworking,lily4ever/AFNetworking,GuitarPlayer-Ma/AFNetworking,bb-coder/AFNetworking,wangxiaoxiang/AFNetworking,BigHub/AFNetworking,rain1988/AFNetworking,Hitta/AFNetworking,jackywpy/AFNetworking,jervine10/AFNetworking,ClassSix/AFNetworking,lowell/AFNetworking,zongmumask/AFNetworking,10045125/AFNetworking,twobitlabs/AFNetworking,BohemianCoding/AFNetworking,reproio/AFNetworking,fuzhiqiang1989/AFNetworking,stevenxiaoyang/AFNetworking,michal-olszewski/AFNetworking-CustomCallbacks,Harvey4431/AFNetworking,b-cuts/AFNetworking,easyui/AFNetworking,dppeak/AFNetworking,crazysniper/AFNetworking,rdignard08/AFNetworking,Allegion-Public/AFNetworking,dvan001/AFNetworking,ichenhui/AFNetworking,Walxyy/AFNetworking,Kjuly/AFNetworking,yeahdongcn/AFNetworking,nxtbgthng/AFNetworking,coderShao/AFNetworking,leontius/AFNetworking,mumer92/AFNetworking,heriwi/AFNetworking,funyun137/zxg,xxkkk/AFNetworking,simX/AFNetworking,pzw224/AFNetworking,wayne798/AFNetworking,YuHuanLi/AFNetworking,ZanderZhang/AFNetworking,bnickel/AFNetworking,JohnSon888/AFNetworking,bensonday/AFNetworking,King-of-Monkey/AFNetworking,donholly/AFNetworking,1debit/AFNetworking,Juraldinio/AFNetworking,HasanSawaed/AFNetworking,CNMrGoat/AFNetworking,AFNetworking/AFNetworking,lianghanlong/AFNetworking,zilaiyedaren/AFNetworking,AdLyft/AFNetworking,yuewenyan/AFNetworking,kosicki123/AFRKNetworking,hnyer/AFNetworking,guorenqing/AFNetworking,matteonovelli/AFNetworking,TongKuo/AFNetworking,dake/AFNetworking,ywzw2013/AFNetworking,liduanw/AFNetworking,zhou18520786640/AFNetworking,andrade911/AFNetworking,uus169/AFNetworking,yuewenyan/AFNetworking,sdonly/AFNetworking,E-B-Smith/AFNetworking,yimouleng/AFNetworking,MQTAN/AFNetworking,brandon-agst/AFNetworking,opentable/AFNetworking,purdyk/AFNetworking,SampleLiao/AFNetworking,RK905/AFNetworking,tianzhilan0/AFNetworking,zhs2010/AFNetworking,aefly/AFNetworking,bespider/AFNetworking,Niko-r/AFNetworking,Livestream/AFNetworking,KeyJohn/AFNetworking,jCalaU/AFNetworking,HSFGitHub/AFNetworking,jeelun/AFNetworking,p4checo/AFNetworking,apanly/AFNetworking,runt18/AFNetworking,shuoshi/AFNetworking,Pingco/AFNetworking,Eveian/AFNetworking,kosicki123/AFRestNetworking,samanalysis/AFNetworking,allpepo/AFNetworking,HappySnowFish/AFNetworking,orta/AFNetworking,DevSonw/AFNetworking,QurateInc/AFNetworking,FelixYin66/AFNetworking,supermarin/AFNetworking,G-P-S/AFNetworking,Chren/AFNetworking,yaruiyang/AFNetworking,wzy911229/AFNetworking,renaudbuisine/MF_AFNetworking,shoobs/AFNetworking-GRG,eahrold/AFNetworking,wymsee/AFNetworking,Farteen/AFNetworking,hh675491601/AFNetworking,manuyavuz/AFNetworking,mengzhilan1197/AFNetworking,johnmyqin/AFNetworking,xuvw/AFNetworking,mhpavl/AFNetworking,kaybutter/AFNetworking,sevnqiao/AFNetworking,w2592583/AFNetworking,zxq3220122/AFNetworking,yangshebing/AFNetworking,wzbozon/AFNetworking,SecuraSeal/AFNetworking,appone/AFNetworking,chromatic-seashell/AFNetworking,devSC/AFNetworking,HT0080/AFNetworking,398539445/AFNetworking,sunkehappy/AFNetworking,moneyfish/AFNetworking,CoreDataMagicMan/AFNetworking,houweilei/AFNetworking,RocketFarm/AFNetworking,iKorich/AFNetworking,target/AFNetworking,knutigro/AFNetworking,pronebird/AFNetworking,zhfish/AFNetworking,wpstarnice/AFNetworking,tangzhentao/AFNetworking,RbBtSn0w/AFNetworking,michal-olszewski/AFNetworking-CustomCallbacks,vuchau/AFNetworking,guorendong/AFNetworking,ddvip1993/AFNetworking,arein/AFNetworking,yeahdongcn/AFNetworking,youprofit/AFNetworking,JohnnySheng/AFNetworking,ReDetection/AFNetworking,wangjiangwen/AFNetworking,lansing/AFNetworking,shwetsolanki/AFNetworking,andyast/AFNetworking_FileCache,kevin-zqw/AFNetworking,cnbin/AFNetworking,Tuzki007/AFNetworking,lansing/AFNetworking,kiurentu/AFNetworking,bruceflowers/AFNetworking,dbcrystal/AFNetworking,SummerHF/AFNetworking,SanjoDeundiak/AFNetworking,sergiou87/AFNetworking,gfiumara/AFNetworking,todotodoo/AFNetworking,glbfor/AFNetworking,p4checo/AFNetworking,littledogboy/AFNetworking,dogvacay/AFNetworking,abbeycode/AFNetworking,jcayzac/AFNetworking,NextThought/AFNetworking,ydatong/AFNetworking,OliverLetterer/AFNetworking,jiarenlong/AFNetworking,Mark0518/AFNetworking,goodheart/AFNetworking,mgv/AFNetworking,g24635381/AFNetworking,Mondaydream/AFNetworking,DevSonw/AFNetworking,VanillaCake/AFNetworking,ferrior30/AFNetworking,CoderIvanLee/AFNetworking,ewanmellor/AFNetworking,yunhappy/AFNetworking,nanthi1990/AFNetworking,singlechou/AFNetworking,xuebuhui52011/AFNetworking,0xced/AFNetworking,jeremiahyan/AFNetworking,jmkr/AFNetworking,cuixinle/AFNetworking,heggy231/AFNetworking,wuxsoft/AFNetworking,jiangtingdong/AFNetworking,udemy/AFNetworking,jiisd/AFNetworking,DevoutCoder/AFNetworking,pingguocaihuiying/AFNetworking,d191562687/AFNetworking,andyast/AFNetworking_FileCache,Liaojinghui/AFNetworking,xingfukun/AFNetworking,HelloZhu/AFNetworking,koamac/AFNetworking.,lilidan/AFNetworking,Fitbit/AFNetworking,GrayWang/AFNetworking,smhjsw/AFNetworking,artemkrachulov/AFNetworking,Yincongxiao/AFNetworking,OmarPedraza/AFNetworking,10fish/AFNetworking,OliverLetterer/AFNetworking,dawangjiaowolaixunshan/AFNetworking,623049115/AFNetworking,Jesee-jia/AFNetworking,lzwjava/AFNetworking,rocklive/AFNetworking,gentlezxz/AFNetworking,marcelohd/AFNetworking,ma762614600/AFNetworking,ahyin007/AFNetworking,yunzhongyoulong/AFNetworking,opentable/AFNetworking,wannaw/AFNetworking,jbinney/AFNetworking,cxx3344/AFNetworking,guogh/AFNetworking,PhuocLinh/AFNetworking,sjpsega/AFNetworking,dreamxing/AFNetworking,abbeycode/AFNetworking,z8927623/AFNetworking_,scottdinggo/AFNetworking,Automatic/AFNetworking,wprice/AFNetworking,wanglj7525/AFNetworking,hyperoslo/AFNetworking,jiuzhishengaigai/AFNetworking,renaudbuisine/MF_AFNetworking,dachaoisme/AFNetworking,purdyk/AFNetworking,hsjcom/AFNetworking,wangxingdaren/AFNetworking,zuojiagai/AFNetworking,aidongsheng/AFNetworking,taozidada/AFNetworking,dilumn/AFNetworking,adozenlines/AFNetworking,nonoBruce/AFNetworking,lexusilia/AFNetworking,matteonovelli/AFNetworking,rowliny/AFNetworking,qkjs/AFNetworking,AFNetworking/AFNetworking,supermarin/AFNetworking,arrouse/AFNetworking,RbBtSn0w/AFNetworking,Cdw0626/AFNetworking,maximmalygin/AFNetworking,E-B-Smith/AFNetworking,WWLJ/AFNetworking,xdkoooo/AFNetworking,phamtuandev/AFNetworking,yaoxiaoyong/AFNetworking,adozenlines/AFNetworking,fguchelaar/AFNetworking,shabbirh/AFNetworking,0xced/AFNetworking,maginawin/AFNetworking,duk42111/AFNetworking,wangwei1237/AFNetworking,kirillslyusar/MyLibrary,qq565999484/AFNetworking,hugo-/AFNetworking,lioonline/AFNetworking,xiaoniu2014/AFNetworking,CoderJFCK/AFNetworking,kiurentu/AFNetworking,zhuzhengwei/AFNetworking,Automatic/AFNetworking,cnhub/AFNetworking,Juraldinio/AFNetworking,leleks/AFNetworking,renssies/AFNetworking,eugene-polyakov/AFNetworking,knutigro/AFNetworking,ewanmellor/AFNetworking,kumasento/AFNetworking,guogh/AFNetworking,D-cocoa/AFNetworking,dawei101/AFNetworking,shanlilaide/AFNetworking,Farteen/AFNetworking,lxzhh/AFNetworking,sea7reen/AFNetworking,280482431/AFNetworking,kaylio/AFNetworking,zhaihm/AFNetworking,perceptual/AFNetwerkin,weiched/AFNetworking,warnyul/AFNetworking,NiuTanJie/AFNetworking,rocklive/AFNetworking,AresPeng/AFNetworking,nonoBruce/AFNetworking,opentable/AFNetworking