summaryrefslogtreecommitdiff
path: root/nchan.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-01 11:09:21 +1000
committerDamien Miller <djm@mindrot.org>2000-04-01 11:09:21 +1000
commitb38eff8e4ff901df9cf1113a9f14d64c3565a401 (patch)
tree9a856898f15f7760ed95c5d47789a6f954b4ad2f /nchan.c
parent450a7a1ff40fe7c2d84c93b83cf2df53445d807d (diff)
- Big OpenBSD CVS update (mainly beginnings of SSH2 infrastructure)
- [auth.c session.c sshd.c auth.h] split sshd.c -> auth.c session.c sshd.c plus cleanup and goto-removal - [bufaux.c bufaux.h] support ssh2 bignums - [channels.c channels.h clientloop.c sshd.c nchan.c nchan.h packet.c] [readconf.c ssh.c ssh.h serverloop.c] replace big switch() with function tables (prepare for ssh2) - [ssh2.h] ssh2 message type codes - [sshd.8] reorder Xr to avoid cutting - [serverloop.c] close(fdin) if fdin != fdout, shutdown otherwise, ok theo@ - [channels.c] missing close allow bigger packets - [cipher.c cipher.h] support ssh2 ciphers - [compress.c] cleanup, less code - [dispatch.c dispatch.h] function tables for different message types - [log-server.c] do not log() if debuggin to stderr rename a cpp symbol, to avoid param.h collision - [mpaux.c] KNF - [nchan.c] sync w/ channels.c
Diffstat (limited to 'nchan.c')
-rw-r--r--nchan.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/nchan.c b/nchan.c
index 0c8066f87..996623fb4 100644
--- a/nchan.c
+++ b/nchan.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#include "includes.h" 30#include "includes.h"
31RCSID("$Id: nchan.c,v 1.5 2000/01/14 04:45:50 damien Exp $"); 31RCSID("$Id: nchan.c,v 1.6 2000/04/01 01:09:24 damien Exp $");
32 32
33#include "ssh.h" 33#include "ssh.h"
34 34
@@ -41,7 +41,6 @@ static void chan_send_ieof(Channel *c);
41static void chan_send_oclose(Channel *c); 41static void chan_send_oclose(Channel *c);
42static void chan_shutdown_write(Channel *c); 42static void chan_shutdown_write(Channel *c);
43static void chan_shutdown_read(Channel *c); 43static void chan_shutdown_read(Channel *c);
44static void chan_delete_if_full_closed(Channel *c);
45 44
46/* 45/*
47 * EVENTS update channel input/output states execute ACTIONS 46 * EVENTS update channel input/output states execute ACTIONS
@@ -73,7 +72,6 @@ chan_rcvd_oclose(Channel *c)
73 error("protocol error: chan_rcvd_oclose %d for istate %d", c->self, c->istate); 72 error("protocol error: chan_rcvd_oclose %d for istate %d", c->self, c->istate);
74 return; 73 return;
75 } 74 }
76 chan_delete_if_full_closed(c);
77} 75}
78void 76void
79chan_read_failed(Channel *c) 77chan_read_failed(Channel *c)
@@ -121,7 +119,6 @@ chan_rcvd_ieof(Channel *c)
121 case CHAN_OUTPUT_WAIT_IEOF: 119 case CHAN_OUTPUT_WAIT_IEOF:
122 debug("channel %d: OUTPUT_WAIT_IEOF -> OUTPUT_CLOSED [rvcd IEOF]", c->self); 120 debug("channel %d: OUTPUT_WAIT_IEOF -> OUTPUT_CLOSED [rvcd IEOF]", c->self);
123 c->ostate = CHAN_OUTPUT_CLOSED; 121 c->ostate = CHAN_OUTPUT_CLOSED;
124 chan_delete_if_full_closed(c);
125 break; 122 break;
126 default: 123 default:
127 error("protocol error: chan_rcvd_ieof %d for ostate %d", c->self, c->ostate); 124 error("protocol error: chan_rcvd_ieof %d for ostate %d", c->self, c->ostate);
@@ -141,7 +138,6 @@ chan_write_failed(Channel *c)
141 debug("channel %d: OUTPUT_WAIT_DRAIN -> OUTPUT_CLOSED [write failed]", c->self); 138 debug("channel %d: OUTPUT_WAIT_DRAIN -> OUTPUT_CLOSED [write failed]", c->self);
142 chan_send_oclose(c); 139 chan_send_oclose(c);
143 c->ostate = CHAN_OUTPUT_CLOSED; 140 c->ostate = CHAN_OUTPUT_CLOSED;
144 chan_delete_if_full_closed(c);
145 break; 141 break;
146 default: 142 default:
147 error("internal error: chan_write_failed %d for ostate %d", c->self, c->ostate); 143 error("internal error: chan_write_failed %d for ostate %d", c->self, c->ostate);
@@ -160,7 +156,6 @@ chan_obuf_empty(Channel *c)
160 debug("channel %d: OUTPUT_WAIT_DRAIN -> OUTPUT_CLOSED [obuf empty, send OCLOSE]", c->self); 156 debug("channel %d: OUTPUT_WAIT_DRAIN -> OUTPUT_CLOSED [obuf empty, send OCLOSE]", c->self);
161 chan_send_oclose(c); 157 chan_send_oclose(c);
162 c->ostate = CHAN_OUTPUT_CLOSED; 158 c->ostate = CHAN_OUTPUT_CLOSED;
163 chan_delete_if_full_closed(c);
164 break; 159 break;
165 default: 160 default:
166 error("internal error: chan_obuf_empty %d for ostate %d", c->self, c->ostate); 161 error("internal error: chan_obuf_empty %d for ostate %d", c->self, c->ostate);
@@ -222,7 +217,7 @@ chan_shutdown_read(Channel *c)
222 error("chan_shutdown_read failed for #%d/fd%d [i%d o%d]: %.100s", 217 error("chan_shutdown_read failed for #%d/fd%d [i%d o%d]: %.100s",
223 c->self, c->sock, c->istate, c->ostate, strerror(errno)); 218 c->self, c->sock, c->istate, c->ostate, strerror(errno));
224} 219}
225static void 220void
226chan_delete_if_full_closed(Channel *c) 221chan_delete_if_full_closed(Channel *c)
227{ 222{
228 if (c->istate == CHAN_INPUT_CLOSED && c->ostate == CHAN_OUTPUT_CLOSED) { 223 if (c->istate == CHAN_INPUT_CLOSED && c->ostate == CHAN_OUTPUT_CLOSED) {