]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg/TftpDynamicCommand: Clarify the retry count option in command.
authorJiaxin Wu <Jiaxin.wu@intel.com>
Mon, 5 Nov 2018 06:52:30 +0000 (14:52 +0800)
committerJiaxin Wu <Jiaxin.wu@intel.com>
Tue, 6 Nov 2018 07:23:38 +0000 (15:23 +0800)
[-c <retry count>] is to define the number of times to transmit request
packets and wait for a response. The default value is 6. But it doesn't
specify the behavior of zero value. Here, The patch is to clear that:
Set to zero also means to use the default value.

Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni

index ccf7abde4290cb25418702961fe60ff476451240..ed081b5bad7cf5a4b5f16ee506d259a20ad6e178 100644 (file)
@@ -218,7 +218,7 @@ EFI_MTFTP4_CONFIG_DATA DefaultMtftp4ConfigData = {
   { { 0, 0, 0, 0 } },               // GatewayIp         - Not relevant as UseDefaultSetting=TRUE\r
   { { 0, 0, 0, 0 } },               // ServerIp          - Not known yet\r
   69,                               // InitialServerPort - Standard TFTP server port\r
   { { 0, 0, 0, 0 } },               // GatewayIp         - Not relevant as UseDefaultSetting=TRUE\r
   { { 0, 0, 0, 0 } },               // ServerIp          - Not known yet\r
   69,                               // InitialServerPort - Standard TFTP server port\r
-  6,                                // TryCount          - Max number of retransmissions.\r
+  6,                                // TryCount          - The number of times to transmit request packets and wait for a response.\r
   4                                 // TimeoutValue      - Retransmission timeout in seconds.\r
 };\r
 \r
   4                                 // TimeoutValue      - Retransmission timeout in seconds.\r
 };\r
 \r
@@ -421,6 +421,10 @@ RunTftp (
     if (!StringToUint16 (ValueStr, &Mtftp4ConfigData.TryCount)) {\r
       goto Error;\r
     }\r
     if (!StringToUint16 (ValueStr, &Mtftp4ConfigData.TryCount)) {\r
       goto Error;\r
     }\r
+\r
+    if (Mtftp4ConfigData.TryCount == 0) {\r
+      Mtftp4ConfigData.TryCount = 6;\r
+    }\r
   }\r
 \r
   ValueStr = ShellCommandLineGetValue (CheckPackage, L"-t");\r
   }\r
 \r
   ValueStr = ShellCommandLineGetValue (CheckPackage, L"-t");\r
index 654e42ad23abad1e46361038d09331eddba8e942..ff6491256441d33c42c9ccde41a88d68d4fc0c37 100644 (file)
@@ -58,7 +58,8 @@
 "                     and the port number is automatically assigned.\r\n"\r
 "  -r port          - Specifies the remote port number. Default value is 69.\r\n"\r
 "  -c <retry count> - The number of times to transmit request packets and\r\n"\r
 "                     and the port number is automatically assigned.\r\n"\r
 "  -r port          - Specifies the remote port number. Default value is 69.\r\n"\r
 "  -c <retry count> - The number of times to transmit request packets and\r\n"\r
-"                     wait for a response. The default value is 6.\r\n"\r
+"                     wait for a response. The default value is 6. Set to zero\r\n"\r
+"                     also means to use the default value.\r\n"\r
 "  -t <timeout>     - The number of seconds to wait for a response after\r\n"\r
 "                     sending a request packet. Default value is 4s.\r\n"\r
 "  -s <block size>  - Specifies the TFTP blksize option as defined in RFC 2348.\r\n"\r
 "  -t <timeout>     - The number of seconds to wait for a response after\r\n"\r
 "                     sending a request packet. Default value is 4s.\r\n"\r
 "  -s <block size>  - Specifies the TFTP blksize option as defined in RFC 2348.\r\n"\r