Git Product home page Git Product logo

fling's People

Contributors

helmutg avatar liwfi avatar lwirzenius avatar rjek avatar rjek-ct avatar sudipm-mukherjee avatar tlsa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

fling's Issues

fling smoke test fails on Windows WSL

Input and output have differing sizes. This could be either a bug in fling or a bug in Microsoft's pipe/splice implementation. Some investigation is warranted, anwyay.
-rw-rw-rw- 1 rjek rjek 1049292800 Dec 8 09:42 fling.in
-rw-rw-rw- 1 rjek rjek 1048096768 Dec 8 09:42 flung.out
Also it is very slow - 27MiB/sec.

-p results in garbage on screen after xfer

I think the -p option results in garbage on screen after a transfer:

18:03 exolobe1:~/.../fling [master]$ ./fling -p exolobe2 8000 < ~/data/v-i/v-i.img 
18:05 exolobe1:~/.../fling [master]$  in 188478.91 seconds, 22.2 kB/sec. 

Note the "in 188478.91 seconds, 22.2 kB/sec." which is left over after the transfer finishes and that the beginning of the line is overwritten by my prompt.

Suggested fix: write out a newline at the end of the transfer before ending the program. This would leave the whole progress report visible.

Also, is the duration correct? 1.9 million seconds seems a lot longer than what I thought it took.

Permissions are 000 when using ssh mode

I ran this:

fling -vp exolobe2:sid.img < sid.img

On exolobe2, I get this:

---------- 1 liw liw 4.0G Dec  7 09:01 sid.img

Ideally, the input file's permissions would be copied, but since fling is designed to take input from stdin, including pipes, those aren't always available. For consistency, I suggest the output file is always created with the same permissions, but they should be usable, without being insecure. Can fling set them to 0600?

Message looks like error, is informational: splicing not possible, trying sendfile

fling currently tells user that it's using sendfile instead of splice:

            fprintf(stdout, "splicing not possible: %s, trying sendfile\n", strerror(errno));

To me, that looks an awful lot like an error message. Would you accept a PR to change the message to something like:

stdin is a pipe, using splice
stdin is a file, using sendfile

Possibly with additional logic to see whether stdin is a pipe or not.

Remote permission errors when flinging via ssh poorly reported

fling unprivileged@remotehost:/root/foo < bar simply reports "unable to connect" rather than any permission error.

Given we currently leave the redirection of stdout to the receiving end's shell and have no way of reliably parsing any error it produces, we should instead include an option to write to a named file rather than stdout.

Ignored return value warnings on compile

A number of warnings are reported on compile

gcc -o fling -O2 -Wall -Wextra -pedantic -std=c99 -lm -lrt fling.c
fling.c: In function ‘spawn_child’:
fling.c:833:13: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  833 |             write(sigpipe[PIPEW], "dup2\n", 5);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fling.c:838:13: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  838 |             write(sigpipe[PIPEW], "dup2\n", 5);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fling.c:843:13: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  843 |             write(sigpipe[PIPEW], "dup2\n", 5);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fling.c:855:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  855 |         write(sigpipe[PIPEW], "exec\n", 5);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fling.c: In function ‘read_number_from_file’:
fling.c:254:5: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
  254 |     fscanf(f, "%d", &v);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.