summaryrefslogtreecommitdiffstats
path: root/sockutil.c
Commit message (Collapse)AuthorAgeFilesLines
* [sockutil] Handle EINTR in send/recv_packetNathan Straz2014-08-201-0/+4
| | | | | | | When we caused system calls not to be restarted on SIGCHLD for select() in qarshd, we also allowed all system calls to be interrupted, including read() and write() in recv/send_packet(). Go back through the loop when we are interrupted.
* [sockutil] Rewrite send_packet() so it retriesNathan Straz2014-08-201-11/+24
| | | | | | If the writev() returned less than expected, we would never check it. In order to make retrying the write simpler, I modelled the new send_packet() after recv_packet().
* Handle errors better in qacpNathan Straz2013-10-021-2/+0
| | | | | | | Pass errors up from the transfer functions so we can keep track of errors and continue trying to transfer all files. Make output more consistent and all on stderr.
* Add reasonable log prioritiesNathan Straz2013-09-191-4/+4
|
* Creat a thin logging layerNathan Straz2013-09-191-4/+7
| | | | | | | 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.
* Clean up compiler warning on psbufNathan Straz2013-09-191-2/+2
|
* Add a loop around getting the packet sizeNathan Straz2013-09-171-10/+11
| | | | Believe it or not, we can get short reads here.
* Remove unused utility functionsNathan Straz2013-09-171-101/+0
|
* Remove complicated remote file descriptor codeNathan Straz2013-09-111-10/+12
| | | | | | | | 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 qacp local to remote working on main socketNathan Straz2013-09-111-49/+33
| | | | | | | | | | 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.
* Move packet sequence numbering to send_packetNathan Straz2013-09-111-1/+4
|
* Convert packet parsingNathan Straz2013-09-111-1/+1
|
* Rewrite qptostr to store binary bits into an existing bufferNathan Straz2013-09-111-11/+11
|
* Start by adding a packet size to the existing protocolNathan Straz2013-09-111-9/+54
|
* Pass hints into getaddrinfoNathan Straz2012-04-191-1/+1
| | | | | Without the hints we could end up creating a non-stream socket which would cause qarsh to hang reading the packet in set_remote_user().
* Merge branch 'ipv6' of ssh://sts-a//home/msp/djansa/src/git/qarsh into ipv6Nathan Straz2010-09-301-30/+98
|\ | | | | | | | | | | Conflicts: qarsh.c sockutil.c
| * First crack at ipv6/ipv4 agnostic qarsh/qacp.Dean Jansa2010-09-281-30/+99
| |
* | Cache last used port in bind_anyNathan Straz2010-09-291-0/+10
|/ | | | This way we don't try to bind to ports we already checked
* Fix Copyright lines. vi sure doesn't like that copyright symbol in my termDean Jansa2008-09-231-1/+1
|
* Plug some memory leaksDean Jansa2008-09-231-4/+2
|
* Add copyright notices and GPL headerNate Straz2008-09-231-0/+19
|
* Use the same size buffer for holding the send packet as the receive packet.Nate Straz2008-09-231-2/+2
|
* Set close on exec flag on our sockets in connect_to_peer()Dean Jansa2008-09-231-0/+13
|
* Fix memory leak in send_packetNate Straz2008-09-231-1/+4
|
* Flatten the qarsh tree.Nate Straz2008-09-231-0/+119