Mercurial > gftp.yaz
diff src/uicommon/gftpui.c @ 442:9d03253b00d0
2004-3-20 Brian Masney <masneyb@gftp.org>
* Officially release 2.0.17pre0
* lib/gftp.h src/uicommon/gftpui.c lib/rfc959.c - if the connection
timed out to the server, return GFTP_ETIMEDOUT. In the UI, if this
error code is returned, immediately reconnect to the server and retry
the operation
* lib/rfc959.c - if the return value from rfc959_send_command() is
< 0, then make sure the exact value is returned instead of
GFTP_ERETRYABLE
author | masneyb |
---|---|
date | Sat, 20 Mar 2004 19:36:05 +0000 |
parents | c5d14dca70c3 |
children | 83cfffb2878a |
line wrap: on
line diff
--- a/src/uicommon/gftpui.c Sat Mar 20 19:17:48 2004 +0000 +++ b/src/uicommon/gftpui.c Sat Mar 20 19:36:05 2004 +0000 @@ -33,7 +33,7 @@ { intptr_t network_timeout, sleep_time; gftpui_callback_data * cdata; - int success, sj; + int success, sj, num_timeouts; cdata = data; gftp_lookup_request_option (cdata->request, "network_timeout", @@ -44,6 +44,7 @@ sj = sigsetjmp (gftpui_common_jmp_environment, 1); gftpui_common_use_jmp_environment = 1; + num_timeouts = 0; success = GFTP_ERETRYABLE; if (sj != 1) { @@ -54,6 +55,13 @@ success = cdata->run_function (cdata); alarm (0); + if (success == GFTP_ETIMEDOUT && num_timeouts == 0) + { + num_timeouts++; + if (gftp_connect (cdata->request) == 0) + continue; + } + if (success == GFTP_EFATAL || success == 0 || cdata->retries == 0) break;