aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-05-05 08:25:39 +0000
committerAndreas Schneider <mail@cynapses.org>2009-05-05 08:25:39 +0000
commitd6e23b76283795eac13ed1cb6e408f54b6003790 (patch)
tree7df7a55369e93337fcac8e8c75845481f19f82aa
parentf9baa6552c989ecb70f166881f4beb1b84d6420a (diff)
downloadlibssh-d6e23b76283795eac13ed1cb6e408f54b6003790.tar.gz
libssh-d6e23b76283795eac13ed1cb6e408f54b6003790.tar.xz
libssh-d6e23b76283795eac13ed1cb6e408f54b6003790.zip
Format channel_open_session1().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@730 7dcaeef0-15fb-0310-b436-a5af3365683c
-rw-r--r--libssh/channels1.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/libssh/channels1.c b/libssh/channels1.c
index fcac073..ac7d25a 100644
--- a/libssh/channels1.c
+++ b/libssh/channels1.c
@@ -33,29 +33,36 @@
#ifdef HAVE_SSH1
-/* this is a big hack. In fact, SSH-1 doesn't make a clever use of channels.
- * The whole packets concerning Shells are sent outside of a channel.
+/*
+ * This is a big hack. In fact, SSH1 doesn't make a clever use of channels.
+ * The whole packets concerning shells are sent outside of a channel.
* Thus, an inside limitation of this behaviour is that you can't only
- * request one Shell.
- * And i don't even know yet how they managed to imbed two "channel"
- * into one protocol.
+ * request one shell.
+ * The question is stil how they managed to imbed two "channel" into one
+ * protocol.
*/
-int channel_open_session1(CHANNEL *chan){
- // we guess we are requesting an *exec* channel. It can only have
- // only one exec channel. so we abort with an error if we need more than
- SSH_SESSION *session=chan->session;
- if(session->exec_channel_opened){
- ssh_set_error(session,SSH_REQUEST_DENIED,"SSH-1 supports only one execution channel. One has already been opened");
- return -1;
- }
- session->exec_channel_opened=1;
- chan->open=1;
- chan->local_maxpacket = 32000;
- chan->local_window = 64000;
- ssh_log(session, SSH_LOG_PACKET, "Opened a ssh1 channel session");
- return 0;
+int channel_open_session1(CHANNEL *chan) {
+ /*
+ * We guess we are requesting an *exec* channel. It can only have one exec
+ * channel. So we abort with an error if we need more than one.
+ */
+ SSH_SESSION *session = chan->session;
+ if (session->exec_channel_opened) {
+ ssh_set_error(session, SSH_REQUEST_DENIED,
+ "SSH1 supports only one execution channel. "
+ "One has already been opened");
+ return -1;
+ }
+ session->exec_channel_opened = 1;
+ chan->open = 1;
+ chan->local_maxpacket = 32000;
+ chan->local_window = 64000;
+ ssh_log(session, SSH_LOG_PACKET, "Opened a SSH1 channel session");
+
+ return 0;
}
+
/* 10 SSH_CMSG_REQUEST_PTY
*
* string TERM environment variable value (e.g. vt100)