46 return (Flags & flags) != 0;
132 protected override void Dispose(
bool disposing)
164 if (readInitalResponseOnConnect)
184 return new WebException(message, innerException, status,
null);
239 int num =
text.IndexOf(
' ');
242 text =
string.Concat(
text.AsSpan(0, num),
" ********");
306 if (index < 0 || index >= commands.Length || commands[
index].
Command !=
"QUIT\r\n")
420 commandStream.
Abort(e);
473 return receiveState.
Resp;
478 int completeLength = -1;
481 int validThrough =
state.ValidThrough;
505 if (completeLength >= 0)
507 int num = state.Resp.StatusBuffer.Length - completeLength;
514 if (completeLength >= 0)
518 state.ValidThrough = validThrough;
542 string text2 =
state.Resp.StatusBuffer.ToString();
543 state.Resp.StatusDescription = text2.Substring(0, completeLength);
546 System.
Net.
NetEventSource.
Info(
this, $
"Received response: {text2.Substring(0, completeLength - 2)}",
"ReceiveCommandResponseCallback");
550 if (
state.Resp !=
null)
virtual int EndRead(IAsyncResult asyncResult)
PipelineEntry(string command)
PipelineEntry(string command, PipelineEntryFlags flags)
bool HasFlag(PipelineEntryFlags flags)
Exception GenerateException(FtpStatusCode code, string statusDescription, Exception innerException)
CommandStream(TcpClient client)
void ReceiveCommandResponseCallback(ReceiveState state, int bytesRead)
static readonly AsyncCallback s_writeCallbackDelegate
ResponseDescription _currentResponseDescription
virtual PipelineEntry[] BuildCommandsList(WebRequest request)
static readonly AsyncCallback s_readCallbackDelegate
void InitCommandPipeline(WebRequest request, PipelineEntry[] commands, bool isAsync)
Stream ContinueCommandPipeline()
PipelineEntry[] _commands
virtual void ClearState()
virtual PipelineInstruction PipelineCallback(PipelineEntry entry, ResponseDescription response, bool timeout, ref Stream stream)
void MarkAsRecoverableFailure()
void InvokeRequestCallback(object obj)
bool PostSendCommandProcessing(ref Stream stream)
override void Dispose(bool disposing)
Stream SubmitRequest(WebRequest request, bool isAsync, bool readInitalResponseOnConnect)
virtual void Abort(Exception e)
bool PostReadCommandProcessing(ref Stream stream)
static void WriteCallback(IAsyncResult asyncResult)
Exception GenerateException(string message, WebExceptionStatus status, Exception innerException)
ResponseDescription ReceiveCommandResponse()
virtual bool CheckValid(ResponseDescription response, ref int validThrough, ref int completeLength)
static void ReadCallback(IAsyncResult asyncResult)
void CheckContinuePipeline()
void RequestCallback(object obj)
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static string GetWebStatusCodeString(FtpStatusCode statusCode, string statusDescription)
override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
override void EndWrite(IAsyncResult asyncResult)
static string net_ftp_receivefailure
static string net_ftp_protocolerror
static string Format(string resourceFormat, object p1)
static string net_ftp_servererror
int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
int GetCharCount(byte[] bytes, int index, int count)
virtual byte[] GetBytes(char[] chars)
virtual Decoder GetDecoder()