fixed time capsule mount timeout

Set the volume_open timeout to 20 seconds to allow an idle time
capsule disk to spin up.
This commit is contained in:
Simon Vetter 2013-03-13 12:15:34 -07:00
parent 93d871128c
commit ec7b7475ab
5 changed files with 8 additions and 8 deletions

View File

@ -3,9 +3,6 @@ These are known bugs in afpfs-ng 0.8:
- this code definitely needs more testing...
- mounting a time capsule can result in a timeout while the disk starts spinning.
(mine takes more than 10 seconds to spin up). Retrying right after always succeeds.
- if afpfsd isnt' running, and you run an 'afp_client exit', it restarts it
and then kills it

View File

@ -1217,7 +1217,7 @@ int cmdline_afp_setup(int recursive, char * url_string)
{
struct passwd * passwd;
snprintf(curdir,sizeof(curdir), DEFAULT_DIRECTORY);
snprintf(curdir, sizeof(curdir), DEFAULT_DIRECTORY);
if (init_uams()<0) return -1;
afp_default_url(&url);

View File

@ -30,6 +30,9 @@ int dsi_recv(struct afp_server * server);
#define DSI_BLOCK_TIMEOUT -1
#define DSI_DONT_WAIT 0
#define DSI_DEFAULT_TIMEOUT 5
//a spun down time capsule can take up to 20 secs to
//wake up and reply to a mount request
#define DSI_OPENVOLUME_TIMEOUT 20
#endif

View File

@ -17,9 +17,9 @@
static unsigned short timeout=10;
struct did_cache_entry {
/* For the example /foo/bar/baz */
char dirname[AFP_MAX_PATH]; /* full name, eg. /foo/bar/ */
unsigned int did; /* eg 2323 */
/* For the example /foo/bar/baz */
char dirname[AFP_MAX_PATH]; /* full name, eg. /foo/bar/ */
unsigned int did; /* eg 2323 */
struct timeval time;
struct did_cache_entry * next;
} ;

View File

@ -184,7 +184,7 @@ int afp_volopen(struct afp_volume * volume,
}
ret=dsi_send(volume->server, (char *) msg,len,
DSI_DEFAULT_TIMEOUT,afpOpenVol,(void *) &volume);
DSI_OPENVOLUME_TIMEOUT,afpOpenVol,(void *) &volume);
free(msg);
return ret;