- Private->ReceivedSize += DataLength;\r
- Percentage = (UINT32) DivU64x64Remainder (MultU64x32 (Private->ReceivedSize, 100), Private->FileSize, NULL);\r
- if (Private->Percentage != Percentage) {\r
- Private->Percentage = Percentage;\r
- Print (L"\r Downloading...%d%%", Percentage);\r
+ }\r
+\r
+ break;\r
+\r
+ case HttpBootHttpEntityBody:\r
+ if (DataLength != 0) {\r
+ if (Private->FileSize != 0) {\r
+ //\r
+ // We already know the file size, print in percentage format.\r
+ //\r
+ if (Private->ReceivedSize == 0) {\r
+ Print (L" File Size: %lu Bytes\n", Private->FileSize);\r
+ }\r
+\r
+ Private->ReceivedSize += DataLength;\r
+ Percentage = (UINT32)DivU64x64Remainder (MultU64x32 (Private->ReceivedSize, 100), Private->FileSize, NULL);\r
+ if (Private->Percentage != Percentage) {\r
+ Private->Percentage = Percentage;\r
+ Print (L"\r Downloading...%d%%", Percentage);\r
+ }\r
+ } else {\r
+ //\r
+ // In some case we couldn't get the file size from the HTTP header, so we\r
+ // just print the downloaded file size.\r
+ //\r
+ Private->ReceivedSize += DataLength;\r
+ Print (L"\r Downloading...%lu Bytes", Private->ReceivedSize);\r