khoih-prog / FTP_Server_Teensy41

FTP Server for Teensy 4.x using SD, LittleFS, etc. with QNEthernet, NativeEthernet, W5x00 with Ethernet_Generic Library or Adafruit Airlift Featherwing using WiFiNINA_Generic Library
GNU General Public License v3.0
6 stars 2 forks source link

Setting FTP_CRED_SIZE on the fly like with FTP_BUF_SIZE #4

Closed davekc closed 2 years ago

davekc commented 2 years ago

FTP_CRED_SIZE is defined to 16 (limiting the credentials to 15 characters actually)

What about setting it to 17 by default or...

Being able to set it on the fly like with FTP_BUF_SIZE

#if (!defined(FTP_CRED_SIZE))
  #warning Using default FTP_CRED_SIZE = 17
  #define FTP_CRED_SIZE 17
#endif

Thanks for the library!

davekc commented 2 years ago

Or course it could be implemented differently. Like:

char user[FTP_CRED_SIZE +1]; // user name
char pass[FTP_CRED_SIZE +1]; // password

Then:

if ( strlen( _user ) > 0 && strlen( _user ) <= FTP_CRED_SIZE )
if ( strlen( _pass ) > 0 && strlen( _pass ) <= FTP_CRED_SIZE )

Just an idea ;)

Kind regards, Dave

khoih-prog commented 2 years ago

Hi @davekc

The new FTP_Server_Teensy41 v1.2.0 has just been published. Your contribution is noted in Contributions and Thanks

Best Regards,


Releases v1.2.0

  1. Add support to WiFiNINA, such as Adafruit Airlift Featherwing
  2. Configurable user_name length to max 63 and user_password to max 127. Check Setting FTP_CRED_SIZE on the fly like with FTP_BUF_SIZE #4