// to accept transfers of unlimited size. So TotalBlock is memorised as \r
// continuous block counter.\r
//\r
- Status = Mtftp4RemoveBlockNum (&Instance->Blocks, Block, &TotalBlock);\r
+ Status = Mtftp4RemoveBlockNum (&Instance->Blocks, Block, Completed, &TotalBlock);\r
\r
if (Status == EFI_NOT_FOUND) {\r
return EFI_SUCCESS;\r
\r
@param Head The block range list to remove from\r
@param Num The block number to remove\r
+ @param Completed Whether Num is the last block number\r
@param TotalBlock The continuous block number in all \r
\r
@retval EFI_NOT_FOUND The block number isn't in the block range list\r
Mtftp4RemoveBlockNum (\r
IN LIST_ENTRY *Head,\r
IN UINT16 Num,\r
+ IN BOOLEAN Completed,\r
OUT UINT64 *TotalBlock\r
)\r
{\r
Range->Round ++;\r
}\r
\r
- if (Range->Start > Range->End) {\r
+ if ((Range->Start > Range->End) || Completed) {\r
RemoveEntryList (&Range->Link);\r
FreePool (Range);\r
}\r
\r
@param Head The block range list to remove from\r
@param Num The block number to remove\r
+ @param Completed Wether Num is the last block number\r
@param TotalBlock The continuous block number in all \r
\r
@retval EFI_NOT_FOUND The block number isn't in the block range list\r
Mtftp4RemoveBlockNum (\r
IN LIST_ENTRY *Head,\r
IN UINT16 Num,\r
+ IN BOOLEAN Completed,\r
OUT UINT64 *TotalBlock\r
);\r
\r
// tell the Mtftp4WrqInput to finish the transfer. This is the last\r
// block number if the block range are empty..\r
//\r
- Mtftp4RemoveBlockNum (&Instance->Blocks, AckNum, &TotalBlock);\r
+ Mtftp4RemoveBlockNum (&Instance->Blocks, AckNum, *Completed,&TotalBlock);\r
\r
Expected = Mtftp4GetNextBlockNum (&Instance->Blocks);\r
\r