Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftp upload crashes after first file #43

Closed
lawrence-jeff opened this issue Apr 25, 2015 · 6 comments
Closed

Ftp upload crashes after first file #43

lawrence-jeff opened this issue Apr 25, 2015 · 6 comments
Labels

Comments

@lawrence-jeff
Copy link

Seeing a few odd things with the FTP code. Using the vanilla example you can upload one file successfully (small html). When you attempt to upload a second small file you get a 150 Connecting response and the next command will give you two consecutive 200 OK responses. I can't get it to upload more than 1 (sometimes 2 files before it starts doing this)

Steps to reproduce on an ESP-01 with 512k flash module
Pull the latest FTPServer example and supporting files
Update SSID and password
Compile
I do a flashinit and then a flash (I believe this Is necessary to clear any old fs remnants)
ESP comes up correctly
Using windows 8.1 built in FTP
Open IPAddress
authenticate with me, 123
lcd to a directory with some static HTML files
set binary mode
put file1.ext - it works you get a connected followed by a Transfer Started followed by a transfer speed summary
put file2.txt - You immediately get a Transfer completed followed by a 200 OK
FTP is hosed at this point and you can't even do a dir, if you exit out and back in you will find the second file is a zero length.

Cut and paste from terminal window
ftp> open 192.168.0.20
Connected to 192.168.0.20.
220 Welcome to Sming FTP
User (192.168.0.20:(none)): me
331 OK
Password:
230 OK
ftp> lcd c:\temp\tinyweb
Local directory now C:\temp\tinyweb.
ftp> binary
250 OK
ftp> put index.html
200 OK
150 Connecting
250 Transfer started
ftp: 2866 bytes sent in 0.08Seconds 36.74Kbytes/sec.
ftp> put api.html
226 Transfer completed
200 OK
ftp> put api.html
150 Connecting
ftp> put api.html
200 OK
200 OK

@alonewolfx2
Copy link
Member

did you tried file upload with ftp client program like filezilla. i can upload many files (small or 30-40kb)

@lawrence-jeff
Copy link
Author

I will retest with filezilla and try to isolate any differences if it works

@anakod
Copy link
Member

anakod commented May 1, 2015

Thank you!

@anakod
Copy link
Member

anakod commented May 1, 2015

Also you can check TotalCommander (should work), maybe it can alow to take additional information.

@anakod
Copy link
Member

anakod commented May 15, 2015

Any news here?

@alonewolfx2
Copy link
Member

yes. its fixed with spiff init.

@anakod anakod closed this as completed May 15, 2015
mikee47 added a commit to mikee47/Sming that referenced this issue Dec 30, 2019
* Fix codacy warning - used `delete` instead of `delete[]`.

* Fix whole-file patching to include sub-directories

* Fix pgmspace.h flies

Add __cplusplus guard to Core/pgmspace.h so it can be #included from C source
Add missing #includes to sys/pgmspace.h

* Remove superfluous Ssl:: qualifiers

* Move validators into Session, add `beginHandshake()` and `endHandshake()` methods.

* Remove `addSslValidator` and `pinCertificate` methods from TcpClient. HttpClientConnection uses Ssl::Session methods instead.

* Add `Connection::freeCertificate()` and use `freeKeyCertAfterHandshake` setting to determine lifetime.

For client applications this means the certificate remains available for the completion callback.

* Simplify axtls port_read() - don't need intermediate buffer

* Rename AXTLS files and classes using `Ax` prefix, remove Connection::calcWriteSize() method.

* Move read method into Connection, add readTcpData(), writeTcpData() and encrypt() methods

Using same algorithm for BR

* Fix validator (wrong method called for PKI)

* Move keyCert handling into AxContext, add Connection::getErrorString() method

* Free tcp buf in Connection, prior to allocating return buffer

* Add AxError strings

Using FlashString Map with minor bugfix

* Add Bear SSL implementation

* Handle handshake completion and verification using callback to Session.

Context contains session reference plus tcp.
Don't use error return from decrypt() to detect handshake
Session resumption handled within Session class

* Working with Basic_SSL sample

* Get rid of Extension class, move settings into Session.

* Sort X509 callback

* Simplify Context interface

Don't need parameters or `setKeyCert` method, just pull required settings from session
Define `Option` enum for session

* Fixup `SSL_DEBUG` handling and add alert code string table

* Fix 16K block handling - don't attempt to reassemble tcp data

* Move Alert/CipherSuite stuff into separate modules, add comment headers

* Dynamically allocate buffer according to fragmentSize setting

* Fix AXTLS abnormal termination

* Move error string stuff into separate module and incorporate AX alert codes

* Add callback mechanism for configuring SSL session

* Add overload for KeyCertPair::assign() to handle Strings

* Copy `make_certs.sh` into ssl Component, keep generated certificates in `cert` directory

* Add instance pointer to TCP connection debug messages

Cannot debug server code because 2 connections get created (with or without SSL)

* Refactor TcpConnection::write

Simplify and get rid of inner loop

* Increase host TCP_MSS to 1390

* Add `TcpConnection::trySend()`

* Implement SSL server connections using HttpServer_ConfigNetwork sample

Load certificate and private key as binary data from flash
SSL Init handler moved into TcpConnection class
Session initialised when TCP connection is accepted (not on listen)
Don't cache connection state in Session, just complicates things

* Add `getAlert` method for introspection

getErrorString and getAlert methods should probably go into the factory (stateless)

* Add BrServerConnection class

Split out into separate modules with common base BrConnection class
mikee47 added a commit to mikee47/Sming that referenced this issue Jan 2, 2020
* Fix codacy warning - used `delete` instead of `delete[]`.

* Fix whole-file patching to include sub-directories

* Fix pgmspace.h flies

Add __cplusplus guard to Core/pgmspace.h so it can be #included from C source
Add missing #includes to sys/pgmspace.h

* Remove superfluous Ssl:: qualifiers

* Move validators into Session, add `beginHandshake()` and `endHandshake()` methods.

* Remove `addSslValidator` and `pinCertificate` methods from TcpClient. HttpClientConnection uses Ssl::Session methods instead.

* Add `Connection::freeCertificate()` and use `freeKeyCertAfterHandshake` setting to determine lifetime.

For client applications this means the certificate remains available for the completion callback.

* Simplify axtls port_read() - don't need intermediate buffer

* Rename AXTLS files and classes using `Ax` prefix, remove Connection::calcWriteSize() method.

* Move read method into Connection, add readTcpData(), writeTcpData() and encrypt() methods

Using same algorithm for BR

* Fix validator (wrong method called for PKI)

* Move keyCert handling into AxContext, add Connection::getErrorString() method

* Free tcp buf in Connection, prior to allocating return buffer

* Add AxError strings

Using FlashString Map with minor bugfix

* Add Bear SSL implementation

* Handle handshake completion and verification using callback to Session.

Context contains session reference plus tcp.
Don't use error return from decrypt() to detect handshake
Session resumption handled within Session class

* Working with Basic_SSL sample

* Get rid of Extension class, move settings into Session.

* Sort X509 callback

* Simplify Context interface

Don't need parameters or `setKeyCert` method, just pull required settings from session
Define `Option` enum for session

* Fixup `SSL_DEBUG` handling and add alert code string table

* Fix 16K block handling - don't attempt to reassemble tcp data

* Move Alert/CipherSuite stuff into separate modules, add comment headers

* Dynamically allocate buffer according to fragmentSize setting

* Fix AXTLS abnormal termination

* Move error string stuff into separate module and incorporate AX alert codes

* Add callback mechanism for configuring SSL session

* Add overload for KeyCertPair::assign() to handle Strings

* Copy `make_certs.sh` into ssl Component, keep generated certificates in `cert` directory

* Add instance pointer to TCP connection debug messages

Cannot debug server code because 2 connections get created (with or without SSL)

* Refactor TcpConnection::write

Simplify and get rid of inner loop

* Increase host TCP_MSS to 1390

* Add `TcpConnection::trySend()`

* Implement SSL server connections using HttpServer_ConfigNetwork sample

Load certificate and private key as binary data from flash
SSL Init handler moved into TcpConnection class
Session initialised when TCP connection is accepted (not on listen)
Don't cache connection state in Session, just complicates things

* Add `getAlert` method for introspection

getErrorString and getAlert methods should probably go into the factory (stateless)

* Add BrServerConnection class

Split out into separate modules with common base BrConnection class
mikee47 added a commit to mikee47/Sming that referenced this issue Jan 2, 2020
* Fix codacy warning - used `delete` instead of `delete[]`.

* Fix whole-file patching to include sub-directories

* Fix pgmspace.h flies

Add __cplusplus guard to Core/pgmspace.h so it can be #included from C source
Add missing #includes to sys/pgmspace.h

* Remove superfluous Ssl:: qualifiers

* Move validators into Session, add `beginHandshake()` and `endHandshake()` methods.

* Remove `addSslValidator` and `pinCertificate` methods from TcpClient. HttpClientConnection uses Ssl::Session methods instead.

* Add `Connection::freeCertificate()` and use `freeKeyCertAfterHandshake` setting to determine lifetime.

For client applications this means the certificate remains available for the completion callback.

* Simplify axtls port_read() - don't need intermediate buffer

* Rename AXTLS files and classes using `Ax` prefix, remove Connection::calcWriteSize() method.

* Move read method into Connection, add readTcpData(), writeTcpData() and encrypt() methods

Using same algorithm for BR

* Fix validator (wrong method called for PKI)

* Move keyCert handling into AxContext, add Connection::getErrorString() method

* Free tcp buf in Connection, prior to allocating return buffer

* Add AxError strings

Using FlashString Map with minor bugfix

* Add Bear SSL implementation

* Handle handshake completion and verification using callback to Session.

Context contains session reference plus tcp.
Don't use error return from decrypt() to detect handshake
Session resumption handled within Session class

* Working with Basic_SSL sample

* Get rid of Extension class, move settings into Session.

* Sort X509 callback

* Simplify Context interface

Don't need parameters or `setKeyCert` method, just pull required settings from session
Define `Option` enum for session

* Fixup `SSL_DEBUG` handling and add alert code string table

* Fix 16K block handling - don't attempt to reassemble tcp data

* Move Alert/CipherSuite stuff into separate modules, add comment headers

* Dynamically allocate buffer according to fragmentSize setting

* Fix AXTLS abnormal termination

* Move error string stuff into separate module and incorporate AX alert codes

* Add callback mechanism for configuring SSL session

* Add overload for KeyCertPair::assign() to handle Strings

* Copy `make_certs.sh` into ssl Component, keep generated certificates in `cert` directory

* Add instance pointer to TCP connection debug messages

Cannot debug server code because 2 connections get created (with or without SSL)

* Refactor TcpConnection::write

Simplify and get rid of inner loop

* Increase host TCP_MSS to 1390

* Add `TcpConnection::trySend()`

* Implement SSL server connections using HttpServer_ConfigNetwork sample

Load certificate and private key as binary data from flash
SSL Init handler moved into TcpConnection class
Session initialised when TCP connection is accepted (not on listen)
Don't cache connection state in Session, just complicates things

* Add `getAlert` method for introspection

getErrorString and getAlert methods should probably go into the factory (stateless)

* Add BrServerConnection class

Split out into separate modules with common base BrConnection class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants