76 _credentials.Target =
value;
210 if (
base.UsingSecureStream)
275 if (
entry.Command ==
"OPTS utf8 on\r\n")
399 if (
response.PositiveIntermediate || (!
base.UsingSecureStream &&
entry.Command ==
"AUTH TLS\r\n"))
437 string text =
string.Empty;
438 string text2 =
string.Empty;
443 if (!
string.IsNullOrEmpty(
domain))
449 if (
text.Length == 0 &&
text2.Length == 0)
452 text2 =
"anonymous@";
490 string text3 = (ftpWebRequest.UseBinary ?
"I" :
"A");
498 string command = ((base.ServerAddress.AddressFamily == AddressFamily.InterNetwork ||
base.ServerAddress.IsIPv4MappedToIPv6) ?
"PASV" :
"EPSV");
503 string command2 = ((base.ServerAddress.AddressFamily == AddressFamily.InterNetwork ||
base.ServerAddress.IsIPv4MappedToIPv6) ?
"PORT" :
"EPRT");
541 return list.ToArray();
555 if (
entry.Command ==
"PASV\r\n" ||
entry.Command ==
"EPSV\r\n")
625 int num =
path.LastIndexOf(
'/');
629 num =
path.LastIndexOf(
'/');
670 if (
array.Length < 2)
680 string[]
array =
str.Split(
' ',
'.');
681 if (
array.Length < 2)
686 if (
text.Length < 14)
697 if (
array.Length > 2)
724 int num2 =
str.LastIndexOf(
'(');
732 text =
text.TrimEnd(
' ',
'.',
'\r',
'\n');
746 if (!uri.
IsBaseOf(result) || uri.
Segments.Length != result.Segments.Length - 1)
756 int num =
str.LastIndexOf(
'(');
774 int num =
str.IndexOf(
'"');
775 int num2 =
str.LastIndexOf(
'"');
776 if (num != -1 &&
num2 != -1 && num !=
num2)
778 return str.Substring(num + 1,
num2 - num - 1);
786 if (
array.Length <= 7)
790 int num = array.Length - 1;
791 if (!
char.IsNumber(
array[num], 0))
803 if (num == -1 ||
num2 <= num)
809 if (
array.Length < 4)
836 if (
base.ServerAddress.AddressFamily ==
AddressFamily.InterNetwork ||
base.ServerAddress.IsIPv4MappedToIPv6)
866 socket.DualMode =
true;
877 if (
response.StatusBuffer.Length < 4)
884 if (!
char.IsDigit(
text[0]) || !
char.IsDigit(
text[1]) || !
char.IsDigit(
text[2]) || (
text[3] !=
' ' &&
text[3] !=
'-'))
888 response.StatusCodeString =
text.Substring(0, 3);
892 response.Multiline =
true;
void Add(TKey key, TValue value)
static long ToInt64(object? value)
static int ToInt32(object? value)
static short ToInt16(object? value)
static byte ToByte(object? value)
static CultureInfo InvariantCulture
Stream ContinueCommandPipeline()
void MarkAsRecoverableFailure()
void InvokeRequestCallback(object obj)
Exception GenerateException(string message, WebExceptionStatus status, Exception innerException)
static WebException RequestAbortedException
StringBuilder _welcomeMessage
FtpLoginState _loginState
static readonly AsyncCallback s_connectCallbackDelegate
static void ConnectCallback(IAsyncResult asyncResult)
string _establishedServerDirectory
override bool CheckValid(ResponseDescription response, ref int validThrough, ref int completeLength)
static void AcceptCallback(IAsyncResult asyncResult)
WeakReference _credentials
FtpControlStream(TcpClient client)
StringBuilder _bannerMessage
DateTime GetLastModifiedFrom213Response(string str)
string FormatAddressV6(IPAddress address, int port)
TriState IsFtpDataStreamWriteable()
static readonly AsyncCallback s_acceptCallbackDelegate
IPEndPoint _passiveEndPoint
override void ClearState()
static void SSLHandshakeCallback(IAsyncResult asyncResult)
static readonly AsyncCallback s_SSLHandshakeCallback
long GetContentLengthFrom213Response(string responseString)
void TryUpdateContentLength(string str)
string GetPortCommandLine(FtpWebRequest request)
override PipelineEntry[] BuildCommandsList(WebRequest req)
int GetPortV6(string responseString)
void TryUpdateResponseUri(string str, FtpWebRequest request)
NetworkCredential Credentials
bool _dataHandshakeStarted
int GetPortV4(string responseString)
void CreateFtpListenerSocket(FtpWebRequest request)
PipelineInstruction QueueOrCreateFtpDataStream(ref Stream stream)
string GetLoginDirectory(string str)
override PipelineInstruction PipelineCallback(PipelineEntry entry, ResponseDescription response, bool timeout, ref Stream stream)
string FormatAddress(IPAddress address, int Port)
static void GetPathInfo(GetPathOption pathOption, Uri uri, out string path, out string directory, out string filename)
string FormatFtpCommand(string command, string parameter)
StringBuilder _exitMessage
Socket CreateFtpDataSocket(FtpWebRequest request, Socket templateSocket)
string _currentTypeSetting
string _requestedServerDirectory
PipelineInstruction QueueOrCreateDataConection(PipelineEntry entry, ResponseDescription response, bool timeout, ref Stream stream, out bool isSocketReady)
override string ToString()
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
NetworkStream NetworkStream
IAsyncResult BeginConnect(EndPoint remoteEP, AsyncCallback? callback, object? state)
unsafe? EndPoint LocalEndPoint
void Bind(EndPoint localEP)
void Connect(EndPoint remoteEP)
IAsyncResult BeginAccept(AsyncCallback? callback, object? state)
static string net_InvalidStatusCode
static string net_ftp_protocolerror
static string net_ftp_response_invalid_format
static string net_ftp_invalid_status_response
static string net_ftp_invalid_uri
static string net_ftp_active_address_different
static string Format(string resourceFormat, object p1)
static string net_ftp_invalid_response_filename
static string net_ftp_server_failed_passive
override string ToString()
StringBuilder Append(char value, int repeatCount)
static bool TryCreate([NotNullWhen(true)] string? uriString, UriKind uriKind, [NotNullWhen(true)] out Uri? result)
string GetComponents(UriComponents components, UriFormat format)
static readonly DateTime MinValue