summaryrefslogtreecommitdiff
path: root/cc3200/ftp
diff options
context:
space:
mode:
authorDaniel Campora <daniel@wipy.io>2015-03-25 13:29:50 +0100
committerDaniel Campora <daniel@wipy.io>2015-03-25 15:22:21 +0100
commit684dba40f03e3b78cabf3a20c563d2913384edc2 (patch)
treefdff73cc17d75b2cf293fc536d211131ad57d0d8 /cc3200/ftp
parente15f8198bc9efa85bfb9ec50ce7a0a0166e69989 (diff)
cc3200: Roll back to the previous telnet and ftp timeouts.
Unfortunately, these timeouts are the only realiable way (for now), to be able to detect broken connections due to half-open sockets. Such a thing occurs when getting out of the WiFi coverage area or when disconnecting from the AP (sometimes the client doesn't send the disconnect packet).
Diffstat (limited to 'cc3200/ftp')
-rw-r--r--cc3200/ftp/ftp.c23
-rw-r--r--cc3200/ftp/ftp.h1
2 files changed, 12 insertions, 12 deletions
diff --git a/cc3200/ftp/ftp.c b/cc3200/ftp/ftp.c
index 6182bf872..e80c27a42 100644
--- a/cc3200/ftp/ftp.c
+++ b/cc3200/ftp/ftp.c
@@ -67,7 +67,7 @@
#define FTP_UNIX_TIME_20150101 1420070400
#define FTP_UNIX_SECONDS_180_DAYS 15552000
#define FTP_DATA_TIMEOUT_MS 5000 // 5 seconds
-#define FTP_CMD_TIMEOUT_MS 300000 // 5 minutes
+#define FTP_CMD_TIMEOUT_MS 120000 // 2 minutes
#define FTP_SOCKETFIFO_ELEMENTS_MAX 4
#define FTP_CYCLE_TIME_MS (SERVERS_CYCLE_TIME_MS * 2)
@@ -224,6 +224,7 @@ static ftp_result_t ftp_list_dir (char *list, uint32_t maxlistsize, uint32_t *li
static void ftp_open_child (char *pwd, char *dir);
static void ftp_close_child (char *pwd);
static void ftp_return_to_previous_path (char *pwd, char *dir);
+static void ftp_reset (void);
/******************************************************************************
DEFINE PUBLIC FUNCTIONS
@@ -405,16 +406,6 @@ void ftp_disable (void) {
ftp_data.state = E_FTP_STE_DISABLED;
}
-void ftp_reset (void) {
- // close all connections and start all over again
- servers_close_socket(&ftp_data.lc_sd);
- servers_close_socket(&ftp_data.ld_sd);
- ftp_close_cmd_data();
- ftp_data.state = E_FTP_STE_START;
- ftp_data.substate.data = E_FTP_STE_SUB_DISCONNECTED;
- SOCKETFIFO_Flush();
-}
-
/******************************************************************************
DEFINE PRIVATE FUNCTIONS
******************************************************************************/
@@ -1055,3 +1046,13 @@ static void ftp_return_to_previous_path (char *pwd, char *dir) {
}
}
}
+
+static void ftp_reset (void) {
+ // close all connections and start all over again
+ servers_close_socket(&ftp_data.lc_sd);
+ servers_close_socket(&ftp_data.ld_sd);
+ ftp_close_cmd_data();
+ ftp_data.state = E_FTP_STE_START;
+ ftp_data.substate.data = E_FTP_STE_SUB_DISCONNECTED;
+ SOCKETFIFO_Flush();
+}
diff --git a/cc3200/ftp/ftp.h b/cc3200/ftp/ftp.h
index 13b044dcf..14f07e0df 100644
--- a/cc3200/ftp/ftp.h
+++ b/cc3200/ftp/ftp.h
@@ -34,6 +34,5 @@ extern void ftp_init (void);
extern void ftp_run (void);
extern void ftp_enable (void);
extern void ftp_disable (void);
-extern void ftp_reset (void);
#endif /* FTP_H_ */