1117 {
1118 RequestStage stage = RequestStage.CheckForError;
1119 try
1120 {
1121 FtpControlStream ftpControlStream =
obj as FtpControlStream;
1122 FtpDataStream ftpDataStream =
obj as FtpDataStream;
1123 Exception ex =
obj as Exception;
1124 bool flag =
obj ==
null;
1126 {
1127 System.
Net.
NetEventSource.
Info(
this, $
"stream:{ftpDataStream} conn:{ftpControlStream} exp:{ex} completedRequest:{flag}",
"AsyncRequestCallback");
1128 }
1129 while (true)
1130 {
1131 if (ex != null)
1132 {
1134 {
1136 if (ftpControlStream == null)
1137 {
1138 return;
1139 }
1140 ex = null;
1141 }
1142 if (ex != null)
1143 {
1145 return;
1146 }
1147 }
1148 if (ftpControlStream == null)
1149 {
1150 break;
1151 }
1153 {
1155 {
1157 {
1159 }
1160 ftpControlStream.CloseSocket();
1161 return;
1162 }
1165 {
1167 }
1168 }
1169 try
1170 {
1172 return;
1173 }
1174 catch (Exception ex2)
1175 {
1176 ex = ex2;
1177 }
1178 }
1179 if (ftpDataStream != null)
1180 {
1182 {
1184 {
1186 return;
1187 }
1189 }
1190 ftpDataStream.SetSocketTimeoutOption(
Timeout);
1192 stage = (ftpDataStream.CanRead ? RequestStage.ReadReady : RequestStage.WriteReady);
1193 }
1194 else
1195 {
1196 if (!flag)
1197 {
1199 }
1201 if (ftpControlStream != null)
1202 {
1205 }
1206 stage = RequestStage.ReleaseConnection;
1207 }
1208 }
1210 {
1212 }
1213 finally
1214 {
1216 }
1217 }
FtpControlStream CreateConnection()
bool AttemptedRecovery(Exception e)
FtpControlStream _connection
FtpWebResponse _ftpWebResponse
void EnsureFtpWebResponse(Exception exception)
RequestStage FinishRequestStage(RequestStage stage)
Stream TimedSubmitRequestHelper(bool isAsync)
void SetException(Exception exception)
void UpdateStatus(FtpStatusCode statusCode, string statusLine, string exitMessage)
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Associate(object first, object second, [CallerMemberName] string memberName=null)