diff cli-chansession.c @ 422:a9e0ddac5ba7 channel-fix

Ignore "exit-signal" request rather than returning failure
author Matt Johnston <matt@ucc.asn.au>
date Mon, 12 Feb 2007 10:37:35 +0000
parents 36d21680a9d3
children 9c61e7af0156
line wrap: on
line diff
--- a/cli-chansession.c	Sun Feb 11 09:55:00 2007 +0000
+++ b/cli-chansession.c	Mon Feb 12 10:37:35 2007 +0000
@@ -64,16 +64,17 @@
 	type = buf_getstring(ses.payload, NULL);
 	wantreply = buf_getbool(ses.payload);
 
-	if (strcmp(type, "exit-status") != 0) {
+	if (strcmp(type, "exit-status") == 0) {
+		cli_ses.retval = buf_getint(ses.payload);
+		TRACE(("got exit-status of '%d'", cli_ses.retval))
+	} else if (strcmp(type, "exit-signal") == 0) {
+		TRACE(("got exit-signal, ignoring it"))
+	} else {
 		TRACE(("unknown request '%s'", type))
 		send_msg_channel_failure(channel);
 		goto out;
 	}
 		
-	/* We'll just trust what they tell us */
-	cli_ses.retval = buf_getint(ses.payload);
-	TRACE(("got exit-status of '%d'", cli_ses.retval))
-
 out:
 	m_free(type);
 }