edk2 icon indicating copy to clipboard operation
edk2 copied to clipboard

NetworkPkg/HttpBootDxe: Resume an interrupted boot file download.

Open leandrobecker-pst opened this issue 1 year ago • 13 comments

When the boot file download operation is interrupted for some reason, HttpBootDxe will use HTTP Range header to try resume the download operation reusing the bytes downloaded so far.

Description

Sometimes while downloading a large boot file, like a Windows PE ISO file, the TCP connection drops and the HTTP operation is terminated with timeout. As HTTP have support to resume interrupted downloads using HTTP Range header, the download operation will be retried to get the remaining file data, keeping data that was already downloaded before the connection drop.

  • [ ] Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • [ ] Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • [ ] Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

Configure the UEFI HTTP Boot feature to download a large .ISO file, like Windows .ISO file. During the file download, remove the uplink cable from your network switch and wait for the number of seconds defined at PCD PcdHttpIoTimeout. Reconnect the uplink cable to your network switch, the download operation must continue from the point were it was stopped.

Integration Instructions

N/A

leandrobecker-pst avatar Aug 08 '24 16:08 leandrobecker-pst

Hi @SaloniKasbekar,

Do I need to close this pull request and start another one? I'm new with this.

Thank you!

leandrobecker-pst avatar Aug 09 '24 10:08 leandrobecker-pst

Hi @SaloniKasbekar,

Do I need to close this pull request and start another one? I'm new with this.

Thank you!

You can amend your commit and push the changes onto your branch. That will directly update this PR. You dont need to close this and start a new PR.

SaloniKasbekar avatar Aug 09 '24 16:08 SaloniKasbekar

Hi @SaloniKasbekar, Do I need to close this pull request and start another one? I'm new with this. Thank you!

You can amend your commit and push the changes onto your branch. That will directly update this PR. You dont need to close this and start a new PR.

Hi @SaloniKasbekar, Do I need to close this pull request and start another one? I'm new with this. Thank you!

You can amend your commit and push the changes onto your branch. That will directly update this PR. You dont need to close this and start a new PR.

Didn't worked. I ammended my commit and when tryied to push to my branch, is has failed. Probably because the previous push I did is now missing from my local copy after the ammend. What do you suggest? Restart from zero? No problem to me. I'm not an git expert.

leandrobecker-pst avatar Aug 09 '24 17:08 leandrobecker-pst

Hi @SaloniKasbekar, Do I need to close this pull request and start another one? I'm new with this. Thank you!

You can amend your commit and push the changes onto your branch. That will directly update this PR. You dont need to close this and start a new PR.

Hi @SaloniKasbekar, Do I need to close this pull request and start another one? I'm new with this. Thank you!

You can amend your commit and push the changes onto your branch. That will directly update this PR. You dont need to close this and start a new PR.

Didn't worked. I ammended my commit and when tryied to push to my branch, is has failed. Probably because the previous push I did is now missing from my local copy after the ammend. What do you suggest? Restart from zero? No problem to me. I'm not an git expert.

Can you share the command you used, and the error? Most likely you'll need to add a --force when pushing to your fork when trying to amend the previous commit.

SaloniKasbekar avatar Aug 09 '24 18:08 SaloniKasbekar

Hi @SaloniKasbekar, Do I need to close this pull request and start another one? I'm new with this. Thank you!

You can amend your commit and push the changes onto your branch. That will directly update this PR. You dont need to close this and start a new PR.

Hi @SaloniKasbekar, Do I need to close this pull request and start another one? I'm new with this. Thank you!

You can amend your commit and push the changes onto your branch. That will directly update this PR. You dont need to close this and start a new PR.

Didn't worked. I ammended my commit and when tryied to push to my branch, is has failed. Probably because the previous push I did is now missing from my local copy after the ammend. What do you suggest? Restart from zero? No problem to me. I'm not an git expert.

Can you share the command you used, and the error? Most likely you'll need to add a --force when pushing to your fork when trying to amend the previous commit.

Using --force did the trick. Thanks

leandrobecker-pst avatar Aug 09 '24 18:08 leandrobecker-pst

As a complement, below is a log from a computer BIOS I'm working with, showing this improvement in action:

... TcpInput: sequence acceptance test failed for segment of TCB 3F27AA98 TcpInput: Discard a packet TcpInput: sequence acceptance test failed for segment of TCB 3F27AA98 TcpInput: Discard a packet HttpBootGetBootFile: Transfer error. Bytes transferred so far: 6502830. TcpOnAppAbort: connection reset issued by application for TCB 3F27AA98 HttpBootLoadFile: Download interrupted, will try to resume the operation. HttpBootGetBootFile: Resuming failed download. Range: bytes=6502830-519127039 HttpBootGetBootFile: If-Match="3413b8488fe0628f20fa77171559f482-62" TlsDecryptPacket: No data read from TLS object. TcpInput: sequence acceptance test failed for segment of TCB 3F27AA98 TcpInput: Discard a packet TcpInput: sequence acceptance test failed for segment of TCB 3F27AA98 TcpInput: Discard a packet DiskIoDxe.Start(42B69618)[PciRoot(0x0)/Pci(0x1F,0x6)/MAC(8080DEADBEEF,0x0)/IPv4(0.0.0.0)/Dns(192.168.3.1)/Uri(https://NOT_SHOW/WinPe.iso)/VirtualCD(0x157B0000,0x346C3FFF,0)]=Success ...

leandrobecker-pst avatar Aug 16 '24 12:08 leandrobecker-pst

I believe that all the required fixes were applied. If you need something else, please let me know.

leandrobecker-pst avatar Aug 20 '24 11:08 leandrobecker-pst

PR can not be merged due to conflict. Please rebase and resubmit

mergify[bot] avatar Aug 27 '24 02:08 mergify[bot]

Hi @SaloniKasbekar.

During the rebase in my local computer, I solved a conflict in source you have changed. When I pushed it again, a conflict happened and a merge was made by GitHub. I undestand that merges are not allowed, so what do you suggest? Delete my branch from GitHub and push it again?

leandrobecker-pst avatar Aug 27 '24 11:08 leandrobecker-pst

Hi @SaloniKasbekar.

During the rebase in my local computer, I solved a conflict in source you have changed. When I pushed it again, a conflict happened and a merge was made by GitHub. I undestand that merges are not allowed, so what do you suggest? Delete my branch from GitHub and push it again?

I'm working with git rebase -i to solve this, please wait...

leandrobecker-pst avatar Aug 27 '24 11:08 leandrobecker-pst

PR can not be merged due to conflict. Please rebase and resubmit

mergify[bot] avatar Aug 27 '24 14:08 mergify[bot]

Hi @SaloniKasbekar. During the rebase in my local computer, I solved a conflict in source you have changed. When I pushed it again, a conflict happened and a merge was made by GitHub. I undestand that merges are not allowed, so what do you suggest? Delete my branch from GitHub and push it again?

I'm working with git rebase -i to solve this, please wait...

@SaloniKasbekar I'll give up. I will open another pull request later and close this one. It keeps conflicting even after I have rebased everything. Maybe I'm too newby using git.

leandrobecker-pst avatar Aug 27 '24 14:08 leandrobecker-pst

Hi @SaloniKasbekar. During the rebase in my local computer, I solved a conflict in source you have changed. When I pushed it again, a conflict happened and a merge was made by GitHub. I undestand that merges are not allowed, so what do you suggest? Delete my branch from GitHub and push it again?

I'm working with git rebase -i to solve this, please wait...

@SaloniKasbekar I'll give up. I will open another pull request later and close this one. It keeps conflicting even after I have rebased everything. Maybe I'm too newby using git.

I think is finally ok. I restarted by branch using the last EDK2 master.

leandrobecker-pst avatar Aug 28 '24 10:08 leandrobecker-pst