Don't use -t timeout for TFTP transfers
This commit is contained in:
parent
4c376a76f8
commit
9a9abfc07c
2 changed files with 7 additions and 1 deletions
4
nmrpd.h
4
nmrpd.h
|
@ -62,6 +62,10 @@
|
|||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef PACKED
|
||||
#define PACKED __attribute__((packed))
|
||||
#endif
|
||||
|
|
4
tftp.c
4
tftp.c
|
@ -315,6 +315,7 @@ int tftp_put(struct nmrpd_args *args)
|
|||
const char *file_remote = args->file_remote;
|
||||
char *val, *end;
|
||||
bool rollover;
|
||||
unsigned rx_timeout = MAX(args->rx_timeout / 200, 1);
|
||||
|
||||
sock = -1;
|
||||
ret = -1;
|
||||
|
@ -367,6 +368,7 @@ int tftp_put(struct nmrpd_args *args)
|
|||
xperror("inet_addr");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
addr.sin_port = htons(args->port);
|
||||
|
||||
blksize = 512;
|
||||
|
@ -447,7 +449,7 @@ int tftp_put(struct nmrpd_args *args)
|
|||
}
|
||||
}
|
||||
|
||||
ret = tftp_recvfrom(sock, rx, &port, args->rx_timeout, blksize + 4);
|
||||
ret = tftp_recvfrom(sock, rx, &port, rx_timeout, blksize + 4);
|
||||
if (ret < 0) {
|
||||
goto cleanup;
|
||||
} else if (!ret) {
|
||||
|
|
Loading…
Add table
Reference in a new issue