Skip to content

Commit

Permalink
Refer to IP from PASV response #16
Browse files Browse the repository at this point in the history
  • Loading branch information
ldab committed Jul 28, 2020
1 parent 8bba164 commit 315e790
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esp32_ftpclient",
"version": "0.1.1",
"version": "0.1.2",
"description": "A FTP-Client for the ESP32",
"keywords": "sensors, low power, mobile, ftp, web, cloud, iot, esp32, espressif",
"authors":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=esp32_ftpclient
version=0.1.1
version=0.1.2
author=Leonardo Bispo
license=MIT
maintainer=Leonardo Bispo <[email protected]>
Expand Down
4 changes: 3 additions & 1 deletion src/ESP32_FTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,12 @@ void ESP32_FTPClient::InitFile(const char* type){
hiPort = array_pasv[4] << 8;
loPort = array_pasv[5] & 255;

IPAddress pasvServer(array_pasv[0],array_pasv[1],array_pasv[2],array_pasv[3]);

FTPdbg(F("Data port: "));
hiPort = hiPort | loPort;
FTPdbgn(hiPort);
if (dclient.connect(serverAdress, hiPort, timeout)) {
if (dclient.connect(pasvServer, hiPort, timeout)) {
FTPdbgn(F("Data connection established"));
}
}
Expand Down

1 comment on commit 315e790

@Qamada
Copy link

@Qamada Qamada commented on 315e790 Jul 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that.

Please sign in to comment.