Skip to content
Browse files

PASV command is now supported.

  • Loading branch information...
1 parent d8d9b91 commit 7a4193ed6957f6ae8040404b551031db48b244ec Jean-David Gadina committed
View
4 EOSFTPServer/FTPServer/Classes/EOSFTPServer+Commands.m
@@ -205,8 +205,10 @@ - ( void )processCommandPASV: ( EOSFTPServerConnection * )connection arguments:
{
__CHECK_AUTH( connection );
- ( void )connection;
( void )args;
+
+ [ connection setTransferMode: EOSFTPServerTransferModePASV ];
+ [ connection openDataSocket: 0 ];
}
- ( void )processCommandTYPE: ( EOSFTPServerConnection * )connection arguments: ( NSString * )args
View
2 EOSFTPServer/FTPServer/Classes/EOSFTPServer.m
@@ -847,7 +847,7 @@ - ( NSString * )messageForReplyCode: ( EOSFTPServerReplyCode )code
case 221: return @"Service closing control connection.";
case 225: return @"Data connection open; no transfer in progress.";
case 226: return @"Closing data connection. Requested file action successful (for example, file transfer or file abort).";
- case 227: return @"Entering Passive Mode (%u,%u,%u,%u,%u,%u).";
+ case 227: return @"Entering Passive Mode (%@,%u,%u).";
case 230: return @"User logged in, proceed.";
case 250: return @"Requested file action okay, completed.";
case 257: return @"%@ created.";
View
5 EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.m
@@ -181,9 +181,10 @@ - ( BOOL )openDataSocket: ( NSUInteger )port
_dataPort = [ _server getPASVDataPort ];
address = [ [ _connectionSocket localHost ] stringByReplacingOccurrencesOfString: @"." withString: @"," ];
- [ _dataSocket acceptOnPort: ( UInt16 )_dataPort error: &e ];
+ NSLog( @"Address: %@", address );
- [ self sendMessage: [ _server formattedMessage: [ NSString stringWithFormat: [ _server messageForReplyCode: 227 ], 0, 0, 0, 0, 0, 0 ] code: 227 ] ];
+ [ _dataSocket acceptOnPort: ( UInt16 )_dataPort error: &e ];
+ [ self sendMessage: [ _server formattedMessage: [ NSString stringWithFormat: [ _server messageForReplyCode: 227 ], address, _dataPort >> 8, _dataPort & 0x00FF ] code: 227 ] ];
break;

0 comments on commit 7a4193e

Please sign in to comment.
Something went wrong with that request. Please try again.