Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for transferring multiple files #2

Merged
merged 12 commits into from
Jul 22, 2024
Merged

Add support for transferring multiple files #2

merged 12 commits into from
Jul 22, 2024

Commits on Jul 12, 2024

  1. Add a transfer plan, transfer names and sizes

    I want to be able to transfer multiple files, and I want the sender to
    control the file name so the receiver does not have to. This adds a step
    in that direction by transferring the plan, but it breaks the actual
    transfer. I'll fix that up next.
    ruuda committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    b5484f7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    76f6c35 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    396fcd7 View commit details
    Browse the repository at this point in the history
  4. Fix bug where file would be closed too early

    For a long time I was puzzled by an "illegal seek" error. It turns out,
    the file was being closed becuase I dropped it immediately. The raw fd
    is like a borrow, I need an owned fd.
    ruuda committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    5335831 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d5aaa23 View commit details
    Browse the repository at this point in the history
  6. Avoid unnecessary arc around fd

    ruuda committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    143a033 View commit details
    Browse the repository at this point in the history
  7. Make the sender stop after everything is sent

    We still need to open a final connection to break the sender out of the
    accept() loop, but I'll do that in a follow-up commit.
    ruuda committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    3d16a6e View commit details
    Browse the repository at this point in the history
  8. Open a final connection to stop the sending side

    It's a hack maybe, but I really want to avoid the async ecosystem.
    ruuda committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    88986a7 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    893509f View commit details
    Browse the repository at this point in the history
  10. Allocate space for the file before we write it

    Not sure if this is a good idea in the end or not, it harms debugging
    but creates cleaner files, which on SSDs probably does not matter but
    on spinning disks it can. But we use SSDs, so I am totally guilty of
    optimizing prematurely here.
    ruuda committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    cfba4cc View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. Add remark about sendfile mutating the offset

    And that we target Linux only.
    ruuda committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    66bc93a View commit details
    Browse the repository at this point in the history
  2. Add a proper usage string

    ruuda committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    745dcb9 View commit details
    Browse the repository at this point in the history