comparison svr-chansession.c @ 6:ab00ef513e97

Sorted out the first channel init issues.
author Matt Johnston <matt@ucc.asn.au>
date Tue, 01 Jun 2004 10:48:46 +0000
parents fe6bca95afa7
children 425ed5c20157
comparison
equal deleted inserted replaced
5:bc6477a6c393 6:ab00ef513e97
48 static int sessionwinchange(struct ChanSess *chansess); 48 static int sessionwinchange(struct ChanSess *chansess);
49 static void execchild(struct ChanSess *chansess); 49 static void execchild(struct ChanSess *chansess);
50 static void addchildpid(struct ChanSess *chansess, pid_t pid); 50 static void addchildpid(struct ChanSess *chansess, pid_t pid);
51 static void sesssigchild_handler(int val); 51 static void sesssigchild_handler(int val);
52 static void closechansess(struct Channel *channel); 52 static void closechansess(struct Channel *channel);
53 static void newchansess(struct Channel *channel); 53 static int newchansess(struct Channel *channel);
54 static void chansessionrequest(struct Channel *channel); 54 static void chansessionrequest(struct Channel *channel);
55 55
56 static void send_exitsignalstatus(struct Channel *channel); 56 static void send_exitsignalstatus(struct Channel *channel);
57 static int sesscheckclose(struct Channel *channel); 57 static int sesscheckclose(struct Channel *channel);
58 58
203 203
204 encrypt_packet(); 204 encrypt_packet();
205 } 205 }
206 206
207 /* set up a session channel */ 207 /* set up a session channel */
208 static void newchansess(struct Channel *channel) { 208 static int newchansess(struct Channel *channel) {
209 209
210 struct ChanSess *chansess; 210 struct ChanSess *chansess;
211 211
212 assert(channel->typedata == NULL); 212 assert(channel->typedata == NULL);
213 213
239 chansess->agentfd = -1; 239 chansess->agentfd = -1;
240 chansess->agentfile = NULL; 240 chansess->agentfile = NULL;
241 chansess->agentdir = NULL; 241 chansess->agentdir = NULL;
242 #endif 242 #endif
243 243
244 return 0;
245
244 } 246 }
245 247
246 /* clean a session channel */ 248 /* clean a session channel */
247 static void closechansess(struct Channel *channel) { 249 static void closechansess(struct Channel *channel) {
248 250
307 unsigned char wantreply; 309 unsigned char wantreply;
308 int ret = 1; 310 int ret = 1;
309 struct ChanSess *chansess; 311 struct ChanSess *chansess;
310 312
311 TRACE(("enter chansessionrequest")); 313 TRACE(("enter chansessionrequest"));
312
313 assert(channel->type == CHANNEL_ID_SESSION);
314 314
315 type = buf_getstring(ses.payload, &typelen); 315 type = buf_getstring(ses.payload, &typelen);
316 wantreply = buf_getbyte(ses.payload); 316 wantreply = buf_getbyte(ses.payload);
317 317
318 if (typelen > MAX_NAME_LEN) { 318 if (typelen > MAX_NAME_LEN) {