comparison svr-chansession.c @ 362:1c7bf9cec6c8 channel-fix

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
author Matt Johnston <matt@ucc.asn.au>
date Mon, 02 Oct 2006 16:34:06 +0000
parents 78518751cb82
children 90cb290836de
comparison
equal deleted inserted replaced
359:78518751cb82 362:1c7bf9cec6c8
57 static void send_exitsignalstatus(struct Channel *channel); 57 static void send_exitsignalstatus(struct Channel *channel);
58 static void send_msg_chansess_exitstatus(struct Channel * channel, 58 static void send_msg_chansess_exitstatus(struct Channel * channel,
59 struct ChanSess * chansess); 59 struct ChanSess * chansess);
60 static void send_msg_chansess_exitsignal(struct Channel * channel, 60 static void send_msg_chansess_exitsignal(struct Channel * channel,
61 struct ChanSess * chansess); 61 struct ChanSess * chansess);
62 static int sess_check_close(struct Channel *channel);
63 static void get_termmodes(struct ChanSess *chansess); 62 static void get_termmodes(struct ChanSess *chansess);
64 63
65 64
66 /* required to clear environment */ 65 /* required to clear environment */
67 extern char** environ; 66 extern char** environ;
68
69 static int sess_check_close(struct Channel *channel) {
70 return channel->writefd == -1;
71 }
72 67
73 /* Handler for childs exiting, store the state for return to the client */ 68 /* Handler for childs exiting, store the state for return to the client */
74 69
75 /* There's a particular race we have to watch out for: if the forked child 70 /* There's a particular race we have to watch out for: if the forked child
76 * executes, exits, and this signal-handler is called, all before the parent 71 * executes, exits, and this signal-handler is called, all before the parent
965 960
966 const struct ChanType svrchansess = { 961 const struct ChanType svrchansess = {
967 0, /* sepfds */ 962 0, /* sepfds */
968 "session", /* name */ 963 "session", /* name */
969 newchansess, /* inithandler */ 964 newchansess, /* inithandler */
970 sess_check_close, /* checkclosehandler */ 965 NULL, /* checkclosehandler */
971 chansessionrequest, /* reqhandler */ 966 chansessionrequest, /* reqhandler */
972 closechansess, /* closehandler */ 967 closechansess, /* closehandler */
973 }; 968 };
974 969
975 970