Commit 4537b296 authored by Mike Hibler's avatar Mike Hibler
Browse files

Change initial connection timeouts again. Be more like BSD libstand version.

parent 819e056e
......@@ -37,7 +37,8 @@ GRUB_MOD_LICENSE ("GPLv3+");
* XXX allow longer for initial connection since it might require spawning
* a server instance.
*/
#define TFTP_INITIAL_TIMO 2000
#define TFTP_MIN_TIMO 2000
#define TFTP_MAX_TIMO 20000
/* IP port for the MTFTP server used for Intel's PXE */
enum
......@@ -408,7 +409,7 @@ tftp_open (struct grub_file *file, const char *filename)
/* Receive OACK packet. */
nbd = nb.data;
for (i = 0; i < GRUB_NET_TRIES; i++)
for (i = TFTP_MIN_TIMO; i < TFTP_MAX_TIMO; i *= 2)
{
nb.data = nbd;
err = grub_net_send_udp_packet (data->sock, &nb);
......@@ -419,8 +420,7 @@ tftp_open (struct grub_file *file, const char *filename)
grub_free (data);
return err;
}
grub_net_poll_cards (TFTP_INITIAL_TIMO + (i * GRUB_NET_INTERVAL_ADDITION),
&data->have_oack);
grub_net_poll_cards (i, &data->have_oack);
if (data->have_oack)
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment