From 67c287d972e255c16d0f915b512bf3c3aa9dc1e7 Mon Sep 17 00:00:00 2001 From: Jean-David Gadina Date: Sun, 19 Feb 2012 21:18:42 +0100 Subject: [PATCH] Added a property for the current directory. --- .../FTPServer/Classes/EOSFTPServerConnection.h | 2 ++ .../FTPServer/Classes/EOSFTPServerConnection.m | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.h b/EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.h index e9d9ee3..526af8d 100644 --- a/EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.h +++ b/EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.h @@ -57,6 +57,7 @@ BOOL _authenticated; NSStringEncoding _encoding; EOSFTPServerConnectionType _type; + NSString * _currentDirectory; id < EOSFTPServerConnectionDelegate > _delegate; @private @@ -68,6 +69,7 @@ @property( atomic, readwrite, assign ) BOOL authenticated; @property( atomic, readwrite, assign ) NSStringEncoding encoding; @property( atomic, readwrite, assign ) EOSFTPServerConnectionType type; +@property( atomic, readwrite, copy ) NSString * currentDirectory; @property( atomic, readwrite, assign ) id < EOSFTPServerConnectionDelegate > delegate; - ( id )initWithSocket: ( AsyncSocket * )socket server: ( EOSFTPServer * )server; diff --git a/EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.m b/EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.m index 96f9547..3b0df23 100644 --- a/EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.m +++ b/EOSFTPServer/FTPServer/Classes/EOSFTPServerConnection.m @@ -46,11 +46,12 @@ @implementation EOSFTPServerConnection -@synthesize username = _username; -@synthesize authenticated = _authenticated; -@synthesize encoding = _encoding; -@synthesize type = _type; -@synthesize delegate = _delegate; +@synthesize username = _username; +@synthesize authenticated = _authenticated; +@synthesize encoding = _encoding; +@synthesize type = _type; +@synthesize currentDirectory = _currentDirectory; +@synthesize delegate = _delegate; - ( id )initWithSocket: ( AsyncSocket * )socket server: ( EOSFTPServer * )server { @@ -64,6 +65,7 @@ - ( id )initWithSocket: ( AsyncSocket * )socket server: ( EOSFTPServer * )server _dataPort = 2001; _queuedData = [ [ NSMutableArray alloc ] initWithCapacity: 100 ]; _encoding = NSUTF8StringEncoding; + _currentDirectory = [ _server.rootDirectory copy ]; [ _connectionSocket setDelegate: self ]; @@ -93,6 +95,7 @@ - ( void )dealloc [ _dataConnection release ]; [ _server release ]; [ _queuedData release ]; + [ _currentDirectory release ]; [ super dealloc ]; }