ASIHTTPRequestプロジェクトがBenによって放棄されたことは理解していますが、とにかく今では他のものに切り替えるには遅すぎるので、私は自分が抱えている問題に対処しようと決心しました。
私はPOSTを行っており、httpsプロトコルを使用してリクエストしています。リクエストに応じて持続的接続を無効にしました。
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setUseKeychainPersistence:YES];
[request setShouldAttemptPersistentConnection:YES];
// Set the request timeout
[request setTimeOutSeconds:REQUEST_TIME_OUT];
// Upload an image
NSData *imageData = UIImagePNGRepresentation(imageContainer.mImage);
[request setPostBody:[NSMutableData dataWithData:imageData]];;
[request setDelegate:self];
[request setDidFinishSelector:@selector(uploadRequestFinished:)];
[request setDidFailSelector:@selector(uploadRequestFailed:)];
[request startAsynchronous];
そして、私が得A connection failure occurred
ているすべてのものkCFErrorDomainCFNetwork error -1005
。
プロジェクトの構成ですべてのデバッグ情報を有効にし、ASIHTTPRequest
次のログを取得しました
[STATUS] Starting asynchronous request <ASIFormDataRequest: 0x1029e000>
[CONNECTION] Request <ASIFormDataRequest: 0x1029e000> will not use a persistent connection
[THROTTLING] ===Used: 0 bytes of bandwidth in last measurement period===
[THROTTLING] ===Used: 327680 bytes of bandwidth in last measurement period===
[CONNECTION] Request attempted to use connection #(null), but it has been closed - will retry with a new connection
[CONNECTION] Request <ASIFormDataRequest: 0x1029e000> will not use a persistent connection
[THROTTLING] ===Used: 229376 bytes of bandwidth in last measurement period===
[THROTTLING] ===Used: 360448 bytes of bandwidth in last measurement period===
[CONNECTION] Request attempted to use connection #(null), but it has been closed - we have already retried with a new connection, so we must give up[STATUS] Request <ASIFormDataRequest: 0x1029e000>: Failed
[CONNECTION] Request #(null) failed and will invalidate connection #(null)ata upload failed "Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0xf624750 {NSUnderlyingError=0xf6246f0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1005.)"
クラッシュが発生する理由はありますか?そしてこれを修正する方法は?