Matt Johnston
6d2d3669f3
Make keepalive handling more robust, this should now match what OpenSSH does
2014-08-19 23:08:56 +08:00
Matt Johnston
0e7409c7ff
Make sure the check_close() handler runs when a server child process exits
2014-07-28 23:23:49 +08:00
Matt Johnston
5cf83a7212
Avoid use-after-free when channel inithandler fails. Thanks to Coverity
2014-07-26 10:18:55 +08:00
Matt Johnston
da57dd13c5
Set tcp priority as follows:
...
if (connecting || ptys || x11) tos = LOWDELAY;
else if (tcp_forwards) tos = 0;
else tos = BULK;
TCP forwards could be either lowdelay or bulk, hence the default priority.
2014-07-16 22:53:32 +08:00
Matt Johnston
1ccac01cee
Make sure client exit messages don't get lost
2014-07-09 00:13:17 +08:00
Matt Johnston
50a5d3756f
Send a failure response if a client receives a global request
2014-07-08 21:59:36 +08:00
Matt Johnston
ca86726f9f
Improve handling lots of concurrent forwarded connections. Increase
...
connection backlog, avoid check_close() for channels that haven't had IO
2014-06-25 23:42:39 +08:00
Matt Johnston
bb7934bf04
A few fixes for cases where compression increases payload sizes, and
...
be more precise about maximum channel sizes
2014-02-22 18:02:09 +08:00
Matt Johnston
bf6f3f613d
Read (and enqueue) packets from interactive input even when
...
we're waiting for a key exchange.
This should hopefully fix the situation where "~." doesn't work to terminate a
client session when a laptop wakes up. The client will be stuck waiting for a
key exchange on a dead connection, so won't have read the escape character
2014-02-17 21:41:06 +08:00
Matt Johnston
dffb33cecf
Improve EOF handling for half-close. Patch from Catalin Patulea
...
Fixes the situation
$ ./dbclient root@1.2.3.4 'cat; echo foo'
^D
<no output>
2013-09-21 00:17:22 +08:00
Matt Johnston
c0d7c6693f
run closehandlers on cleanup
2013-04-10 21:32:55 +08:00
Matt Johnston
90cf7f012c
Move the more verbose TRACE() statements into TRACE2()
2013-04-01 00:07:26 +08:00
Matt Johnston
5996c3824c
Add ~. and ~^Z handling to exit/suspend dbclient
2013-03-23 23:16:06 +08:00
Matt Johnston
804a1e69f2
use an empty writebuf rather than a NULL one
2013-03-20 22:31:07 +08:00
Matt Johnston
4fd4fbc255
Fix memory leak when direct TCP connections time out on connection.
...
Long-standing bug probably stemming from the awkwardly named
delete_channel() versus remove_channel()
2013-03-19 23:54:32 +08:00
Matt Johnston
2a02c4084a
- Don't sent SSH_MSG_UNIMPLEMENTED if we don't have ENABLE_SVR_REMOTETCPFWD
...
- Fix build if ENABLE_SVR_REMOTETCPFWD is disabled but ENABLE_SVR_LOCALTCPFWD
is enabled
2012-05-09 20:33:16 +08:00
Matt Johnston
baa32218b0
- Make sure we don't use channel-specific data after it has been freed
...
with a ChanType->closehandler()
2011-12-04 05:27:29 +08:00
Matt Johnston
38ed870ffe
Improve capitalisation for all logged strings
...
--HG--
extra : convert_revision : 997e53cec7a9efb7413ac6e17b6be60a5597bd2e
2011-02-23 15:50:30 +00:00
Matt Johnston
adc4d0194f
Idle timeout patch from Farrell Aultman. Needs testing, unsure if server
...
code works
--HG--
extra : convert_revision : ff66e05ae040561110af70114bf83f11ed528f05
2008-11-07 14:11:06 +00:00
Matt Johnston
ed79abed76
Don't use // style comments
...
--HG--
extra : convert_revision : c92c7b4fef739b505d9842b45a393e1089097e3b
2008-11-02 12:01:39 +00:00
Matt Johnston
b98d13effb
Don't send anything in response to a SSH_MSG_CHANNEL_REQUEST if we have
...
already sent a SSH_MSG_CHANNEL_CLOSE. This fixes a bug triggered by more
recent versions of putty with tcp fowarding and window adjustment request
messages.
--HG--
extra : convert_revision : 10b2f286b9886364db39dfbb4f8f46e49e345d87
2008-09-23 12:03:01 +00:00
Matt Johnston
6c9d2abc75
Don't return until the shell has quit. This will ensure that an exit status
...
is always returned.
--HG--
extra : convert_revision : 32fc88053016994100eb0ef17f75592881c90d97
2008-02-21 14:46:15 +00:00
Matt Johnston
e3e4445dc1
Add -W <windowsize> argument and document it.
...
--HG--
extra : convert_revision : 98d4c0f15480bf749c451034cbc565d7e9d3b8dc
2007-07-25 15:44:25 +00:00
Matt Johnston
2d4d9627a2
Rearrange the channel buffer sizes into three neat use-editable values in
...
options.h. Increasing RECV_MAX_WINDOW gives big network performance
increases - even with the present buffers (which haven't changed) it
performs a lot better.
Next step is to make the window size a cmdline option.
--HG--
extra : convert_revision : 24c7cb47fb56cf5b82e3bc0859b45ea83038eab0
2007-07-24 15:40:23 +00:00
Matt Johnston
62d792fbdc
Fix a stupid bug s/readfd/errfd/ affecting channel close on child exit
...
--HG--
extra : convert_revision : 16dd04147563e91faaa44de193dece0f4056ec7a
2007-02-22 16:17:09 +00:00
Matt Johnston
7f12251fbb
Fix for -pedantic -ansi compilation, change // to /**/, plus some signedness
...
and trailing-comma-in-array issues
--HG--
extra : convert_revision : c22be8b8f570b48e9662dac32c7b3e7148a42206
2007-02-16 14:42:08 +00:00
Matt Johnston
22440a6fb2
- Fix bug in child-exit handling where the wrong pid was being matched.
...
- Also wait for errfd to close before closing the channel
--HG--
branch : channel-fix
extra : convert_revision : ed68ea8963f7d1fa600f81479e7e211efc5a31bc
2007-02-12 10:39:22 +00:00
Matt Johnston
f5ad5c1553
Improve behaviour when flushing out after a process has exited.
...
--HG--
branch : channel-fix
extra : convert_revision : e73ee8f7ae404a9355685c30828a0ad4524031bc
2007-02-09 10:43:16 +00:00
Matt Johnston
d199e0b119
disapproval of revision '1dfbc5ef92391d01b576c8506061927869a89887'
...
--HG--
branch : channel-fix
extra : convert_revision : 73fe066c5d9e2395354ba74756124d45c978a04d
2007-02-06 15:59:54 +00:00
Matt Johnston
4e09d27c6f
Add some code for testing whether a writefd is closed (by read()ing from it)
...
--HG--
branch : channel-fix
extra : convert_revision : 1dfbc5ef92391d01b576c8506061927869a89887
2006-12-05 15:23:06 +00:00
Matt Johnston
e1d3a8a6e9
- Add some extra tracing.
...
- Be clearer about errfd be used for read versus write with
ERRFD_IS_READ and ERRFD_IS_WRITE macros
--HG--
branch : channel-fix
extra : convert_revision : 8778af05d9573c68b0d859feb7079502b46ed769
2006-12-05 14:42:03 +00:00
Matt Johnston
5b8a26f1d1
Remove accidentally removed block (making sure to close the channel).
...
Other minor cleanups.
--HG--
branch : channel-fix
extra : convert_revision : 7559a8cc4f6abe2338636f2aced3a395a79c172c
2006-10-11 14:44:00 +00:00
Matt Johnston
cc340d9cdc
Passes most test cases now
...
--HG--
branch : channel-fix
extra : convert_revision : 5a5f398411a7a3baa9472daa80fea0574fbd8a9a
2006-10-09 16:31:00 +00:00
Matt Johnston
786ea39ac4
Rearranged (and hopefully simplified) channel close/eof handling
...
--HG--
branch : channel-fix
extra : convert_revision : d44aac5fec50b1d20515da77d410d3c511f16277
2006-10-07 17:48:55 +00:00
Matt Johnston
df57eb3824
Rearranged some more bits, marked some areas that need work.
...
* send_msg_channel_data() no longer allocates a separate buffer
* getchannel() handles unknown channels so callers don't have to
--HG--
branch : channel-fix
extra : convert_revision : 3db645581be0fbb0d2ac8d218fbd55e096cbbbe5
2006-10-02 16:34:06 +00:00
Matt Johnston
7e04c5e277
just shuffle some variables names about, a brief comment
...
about the "bad writefd" problem
--HG--
branch : channel-fix
extra : convert_revision : f0b407c3d3e047ed83174e6f4ebd85a19352df5b
2006-10-01 16:35:13 +00:00
Matt Johnston
4313157666
fix accidentally changed == vs != operators
...
--HG--
extra : convert_revision : a2345a9e53fcb35bde9f3701406e285c1ef80481
2006-06-11 16:37:46 +00:00
Matt Johnston
e8fa3ce478
progress towards exiting on writefd closure rather than
...
on process exit - dbclient hangs with scp, so requires work.
--HG--
extra : convert_revision : 2186a678a5f79ef432f6593a10e3e13df2a313d5
2006-06-11 16:19:32 +00:00
Matt Johnston
c9d3c0bc90
merge of 332f709a4cb39cde4cedab7c3be89e05f3023067
...
and ca4ca78b82c5d430c69ce01bf794e8886ce81431
--HG--
extra : convert_revision : 74020525425a1de06739c6c3bed9ef35e4ad867e
2006-06-10 16:39:40 +00:00
Matt Johnston
94d86427ff
disapproval of revision 'a4c1a9be4db326f8f7adcf30f876fadedf87b203'
...
--HG--
extra : convert_revision : 332f709a4cb39cde4cedab7c3be89e05f3023067
2006-06-10 16:39:37 +00:00
Matt Johnston
1e03393b68
Some cleanups/fixes for various TRACE statements
...
--HG--
extra : convert_revision : 84eb6fedc6df0666f8053b9018bf16635dbfb257
2006-03-25 12:57:37 +00:00
Matt Johnston
e4697de175
merge of 4cbdd6e0a0d8c061075b9ed7609a06c4547f67d3
...
and 5d396842815593611f0d61762440145d1fc74d5a
--HG--
extra : convert_revision : 4c883eb469d2d251ee8abddbc11ae4005db6da17
2006-03-08 12:53:09 +00:00
Matt Johnston
1dc0652444
Stomp on some minor warnings
...
--HG--
extra : convert_revision : 4cbdd6e0a0d8c061075b9ed7609a06c4547f67d3
2006-03-08 12:09:02 +00:00
Matt Johnston
b05ab854ae
Check that the output circular buffer is actually empty before
...
closing the channel (thanks to Tomas Vanek for his help).
--HG--
extra : convert_revision : 7fb3ca52f21072127c9615a5bdbc054c24669e51
2006-01-25 17:13:38 +00:00
Matt Johnston
a4bf09e7b9
* common-channel.c: get rid of the read()-from-writefd code
...
which caused problems when redirecting to or from /dev/null
--HG--
extra : convert_revision : a4c1a9be4db326f8f7adcf30f876fadedf87b203
2005-12-06 17:32:53 +00:00
Matt Johnston
b131f74533
* rename infd/outfd to writefd/readfd, to avoid confusion
...
--HG--
extra : convert_revision : e3e7dc2cf75ad60c83a5b4307c210fee2fe90434
2005-10-20 16:53:12 +00:00
Matt Johnston
18b082955b
* ensure that we only handle open confirmation/failure
...
for channels where it is expected
--HG--
extra : convert_revision : acc1ba014aae08ecb3159282fe87defe67899a40
2005-09-05 17:10:32 +00:00
Matt Johnston
53681cbdb6
* use own assertions which should get logged properly
...
--HG--
extra : convert_revision : 3dc365619f0840ab5781660b1257a9f22c05d3fe
2005-09-05 15:16:10 +00:00
Matt Johnston
5002c95048
* close a file descriptor after we've shutdown() both sides, to avoid a leak
...
--HG--
extra : convert_revision : 06fda32c634cf16a4c75797441ec2bd533f571c6
2005-07-08 15:04:06 +00:00
Matt Johnston
298a5717bc
compile fix when TRACE debugging is enabled
...
--HG--
extra : convert_revision : 7844ac7e5a24b88231de2af7520c49e56820a87c
2005-05-04 15:31:17 +00:00