summaryrefslogtreecommitdiffstats
path: root/qarshd.c
Commit message (Collapse)AuthorAgeFilesLines
* [qarshd] Fix timeout when child exitsNathan Straz2014-07-221-2/+8
| | | | | | | | | We ran into an issue where qarsh would wait for 3 seconds after a command ran. This was traced back to the select() in handle_qarsh() being restarted when SIGCHLD was received. I moved the waitpid() to just before the select() and turned off the signal restart. This closes those timing windows and allows qarshd to quickly finish after the child exits.
* Don't check childfds after we've closed one.Nathan Straz2013-12-191-3/+3
| | | | This was hitting easily on RHEL5 systems
* Remove child signal handlingNathan Straz2013-10-041-19/+5
| | | | | Instead of moving the setup for SIGCHLD handling, I'm removing it. waitpid() isn't that expensive and we know the pid we are waiting for.
* Remove unused variablesNathan Straz2013-10-021-5/+0
|
* Remove stat cache which isn't used anymoreNathan Straz2013-10-021-13/+0
|
* Remove offset from data packetNathan Straz2013-10-021-59/+4
| | | | | We really don't need this field since we always copy data sequentially.
* Rewrite qacp receive file to handle all packetsNathan Straz2013-10-021-11/+44
|
* Rewrite send file to handle all packetsNathan Straz2013-10-021-8/+11
| | | | | | | | | This change breaks the qacp protocol! Before there was a chance we would exit before receiving and checking all packets from qarshd. Now we look at all packets and check them. Use data allow packets and larger buffers. Handle errors on the write end.
* Handle stdin pipe closing on usNathan Straz2013-09-191-2/+9
| | | | | | | If xiogen is flooding requests across qarsh and xdoio decides to stop, we need to handle that gracefully. Also, making the pipe non-blocking was not a good idea, xdoio gets the read error EAGAIN and stops there.
* Fix typoNathan Straz2013-09-191-1/+1
|
* Creat a thin logging layerNathan Straz2013-09-191-0/+14
| | | | | | | When qarshd is run via xinetd, stderr still goes out the socket and messages from sockutil.c or qarsh_packet.c can interfere with the protocol. Create a thin wrapper which qacp and qarsh can send to stderr and qarshd can send to syslog.
* Don't block writing to child's stdinNathan Straz2013-09-171-2/+2
|
* Increase buffer and packet sizesNathan Straz2013-09-161-4/+4
| | | | | | | | | This coordinates the buffer sizes with the max packet size. qarshd and qarsh will probably break if this value does not match between client and server builds. Also increase the value to reduce overhead. A max packet size of 16k only yields 40MB/s. Increase that to 128k and we can do 500MB/s.
* Fix up stdin handlingNathan Straz2013-09-111-6/+18
|
* Close both ends of the pipes so we don't leak file descriptorsNathan Straz2013-09-111-0/+3
|
* Clean up memory leaks and uninitialized variables in qarshdNathan Straz2013-09-111-0/+5
|
* Only log debug entries if the debug flag is set.Nathan Straz2013-09-111-2/+2
|
* Remove complicated remote file descriptor codeNathan Straz2013-09-111-27/+19
| | | | | | | | Only handle one file transfer at a time so we don't need an array to track multiple transfers or know the remote's fd number. Loop in recv_packet until we read a whole packet.
* Get commands running over one socketNathan Straz2013-09-111-51/+203
| | | | Added a new packet to limit data sent from the other side.
* Add option to pause at startupNathan Straz2013-09-111-5/+10
| | | | | | This allows us to attach gdb before anything interesting happens. Use the command 'signal 14' to get the process running again.
* Get qacp remote to local workingNathan Straz2013-09-111-24/+35
|
* Get qacp local to remote working on main socketNathan Straz2013-09-111-72/+65
| | | | | | | | | | I removed the buffering layer from recv_packet because it made the logic too complex around the pselect in qarshd. Now only read as much as needed to get each packet. qarshd adds an array for remote file descriptors which is only a stub for now. This needs to be expanded to allow multiple file transfers at the same time for runcmd.
* Send all server side error messages to stderrNathan Straz2013-09-111-1/+1
| | | | This should get sent to the journal or syslog
* Restore original sigmask before exec'ing childNathan Straz2012-07-191-1/+3
|
* First crack at ipv6/ipv4 agnostic qarsh/qacp.Dean Jansa2010-09-281-6/+13
|
* Set child_pid to 0 after child returnsNathan Straz2010-06-031-0/+1
| | | | This is mostly for clarity while debugging qarshd.
* Handle growing files better in qacpNathan Straz2009-09-141-3/+19
| | | | | | Cache the results from the rstat packet and use that file size during the following sendfile so we don't send more than qacp is expecting. This should allow us to qacp root@host:/var/log/messages
* Fix up copyright dates.Nate Straz2008-09-231-1/+1
|
* Don't print out the debug syslog messages unless you also use the -d option.Nate Straz2008-09-231-3/+8
| | | | For those that can't configure syslog properly while debugging other things.
* Nate made a good point, we should not fail if we can't chdir. ssh warns, ↵Dean Jansa2008-09-231-5/+1
| | | | but lets you in. Don't bother checking the return of chdir().
* chdir() to users home dirDean Jansa2008-09-231-0/+8
|
* Cast off_t variables to long long int when printing so we don't get theNate Straz2008-09-231-5/+7
| | | | | | | | ugly warnings. We should always be compiling with 64-bit off_t's so this should not be a problem. Change nread and nwrote back to ssize_t's since that is what read and write return. nleft remains an off_t because we initialize to stat.st_size.
* Use off_t instead of size_t so we can transfer files larger than 2GB.Nate Straz2008-09-231-9/+10
| | | | | | I changed all formats from %zd to %lld, but this adds a lot of warnings because off_t isn't the same as long long int to the compiler. I don't know if there is a way to avoid the warnings on all platforms.
* Add copyright notices and GPL headerNate Straz2008-09-231-1/+19
|
* Quiet down the logging a bit.Nate Straz2008-09-231-1/+1
|
* Merge qarsh revisions 1727:1738 from sistina-test branch djansa-qarsh.Nate Straz2008-09-231-6/+56
|
* Flatten the qarsh tree.Nate Straz2008-09-231-0/+315