Skip to content

Commit a45b8bf

Browse files
committed
Upgrade information update
1 parent 20f9eac commit a45b8bf

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

docfx_project/articles/upgrade-3.0.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ title: Upgrade from 2.x to 3.0
1010
- [Membership provider changes](#membership-provider-changes)
1111
- [Connection](#connection)
1212
- [Connection data changes](#connection-data-changes)
13+
- [Data connections](#data-connections)
1314
- [FTP middleware](#ftp-middleware)
1415
- [FTP request middleware](#ftp-request-middleware)
1516
- [FTP command execution middleware](#ftp-command-execution-middleware)
@@ -127,18 +128,31 @@ CurrentDirectory | [`IFileSystemFeature`](xref:FubarDev.FtpServer.Feature
127128
Language | [`ILocalizationFeature`](xref:FubarDev.FtpServer.Features.ILocalizationFeature)
128129
Catalog | [`ILocalizationFeature`](xref:FubarDev.FtpServer.Features.ILocalizationFeature)
129130
TransferMode | [`ITransferConfigurationFeature`](xref:FubarDev.FtpServer.Features.ITransferConfigurationFeature)
130-
PortAddress | [`ITransferConfigurationFeature`](xref:FubarDev.FtpServer.Features.ITransferConfigurationFeature)
131-
TransferTypeCommandUsed | [`ITransferConfigurationFeature`](xref:FubarDev.FtpServer.Features.ITransferConfigurationFeature)
131+
PortAddress | Removed
132+
TransferTypeCommandUsed | Removed
132133
RestartPosition | [`IRestCommandFeature`](xref:FubarDev.FtpServer.Features.IRestCommandFeature)
133134
RenameFrom | [`IRenameCommandFeature`](xref:FubarDev.FtpServer.Features.IRenameCommandFeature)
134135
ActiveMlstFacts | [`IMlstFactsFeature`](xref:FubarDev.FtpServer.Features.IMlstFactsFeature)
135-
PassiveSocketClient | [`ISecureConnectionFeature`](xref:FubarDev.FtpServer.Features.ISecureConnectionFeature)
136+
PassiveSocketClient | Removed
136137
BackgroundCommandHandler| [`IBackgroundTaskLifetimeFeature`](xref:FubarDev.FtpServer.Features.IBackgroundTaskLifetimeFeature)
137138
CreateEncryptedStream | [`ISecureConnectionFeature`](xref:FubarDev.FtpServer.Features.ISecureConnectionFeature)
138139

139140

140141
There's no direct replacement for the `UserData` property, but you can use the feature collection too.
141142

143+
## Data connections
144+
145+
We're now using two factories to create data connections:
146+
147+
- [`ActiveDataConnectionFeatureFactory`](xref:FubarDev.FtpServer.DataConnection.ActiveDataConnectionFeatureFactory) for active data connections (`PORT`/`EPRT` commands)
148+
- [`PassiveDataConnectionFeatureFactory`](xref:FubarDev.FtpServer.DataConnection.PassiveDataConnectionFeatureFactory) for passive data connections (`PASV`/`EPSV` commands)
149+
150+
This factories create a [`IFtpDataConnectionFeature`](xref:FubarDev.FtpServer.Features.IFtpDataConnectionFeature) which is used to create [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementations. This allows us to abstract away the differences between active and passive data connections.
151+
152+
The function `IFtpConnection.CreateResponseSocket` was replaced by [`IFtpConnection.OpenDataConnectionAsync`](xref:FubarDev.FtpServer.IFtpConnection.OpenDataConnectionAsync) and returns a [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementation. This function also takes care of SSL/TLS encryption as it wraps the [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementation returned by the [`IFtpDataConnectionFeature`](xref:FubarDev.FtpServer.Features.IFtpDataConnectionFeature) into a new [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementation with the help of the [`SecureDataConnectionWrapper`](xref:FubarDev.FtpServer.DataConnection.SecureDataConnectionWrapper).
153+
154+
The extension method `SendResponseAsync` on the `IFtpConnection` was replaced by [`SendDataAsync`](xref:FubarDev.FtpServer.ConnectionExtensions.SendDataAsync) and takes care of closing the [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection).
155+
142156
# FTP middleware
143157

144158
There are two types of middlewares:
@@ -258,14 +272,13 @@ and [`FtpCommandCollector`](xref:FubarDev.FtpServer.FtpCommandCollector).
258272
## What's changed?
259273

260274
- Google drive upload without background uploader
275+
- The `IFtpCommandHandler.GetExtensions()` is now deprecated as all extensions that were previously returned here have their own implementation now
261276
- BREAKING: Usage of `ReadOnlySpan` in the FTP command collector
262-
- BREAKING: [`IFileSystemClassFactory.Create`](xref:FubarDev.FtpServer.FileSystem.IFileSystemClassFactory.Create(FubarDev.FtpServer.IAccountInformation))
263-
takes an [`IAccountInformation`](xref:FubarDev.FtpServer.IAccountInformation)
277+
- BREAKING: [`IFileSystemClassFactory.Create`](xref:FubarDev.FtpServer.FileSystem.IFileSystemClassFactory.Create(FubarDev.FtpServer.IAccountInformation)) takes an [`IAccountInformation`](xref:FubarDev.FtpServer.IAccountInformation)
264278
- BREAKING: The [`IMembershipProvider`](xref:FubarDev.FtpServer.AccountManagement.IMembershipProvider) is now asynchronous
265279
- BREAKING: `FtpConnectionData.IsAnonymous` is obsolete, the anonymous user is now of type [`IAnonymousFtpUser`](xref:FubarDev.FtpServer.AccountManagement.IAnonymousFtpUser)
266-
- The `IFtpCommandHandler.GetExtensions()` is now deprecated as all extensions that were previously returned here have
267-
their own implementation now
268280
- BREAKING: Moved [`PromiscuousPasv`](xref:FubarDev.FtpServer.PasvCommandOptions.PromiscuousPasv) into [`PasvCommandOptions`](xref:FubarDev.FtpServer.PasvCommandOptions)
281+
- BREAKING: Removed property `PortAddress`, `TransferTypeCommandUsed`, and `PassiveSocketClient` from `FtpConnectionData`, because we're using a new [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) abstraction
269282

270283
## What's fixed?
271284

0 commit comments

Comments
 (0)