summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/channels.c18
-rw-r--r--usr.bin/ssh/channels.h8
-rw-r--r--usr.bin/ssh/ssh.c6
3 files changed, 12 insertions, 20 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index 126ba94c54b..c5fc12c1c35 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.164 2002/02/03 17:55:55 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.165 2002/02/03 17:58:21 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -260,12 +260,10 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
c->remote_name = remote_name;
c->remote_window = 0;
c->remote_maxpacket = 0;
- c->cb_fn = NULL;
- c->cb_arg = NULL;
- c->cb_event = 0;
c->force_drain = 0;
c->single_connection = 0;
c->detach_user = NULL;
+ c->confirm = NULL;
c->input_filter = NULL;
debug("channel %d: new [%s]", found, remote_name);
return c;
@@ -610,16 +608,14 @@ channel_request_start(int id, char *service, int wantconfirm)
packet_put_char(wantconfirm);
}
void
-channel_register_callback(int id, int mtype, channel_callback_fn *fn, void *arg)
+channel_register_confirm(int id, channel_callback_fn *fn)
{
Channel *c = channel_lookup(id);
if (c == NULL) {
- log("channel_register_callback: %d: bad id", id);
+ log("channel_register_comfirm: %d: bad id", id);
return;
}
- c->cb_event = mtype;
- c->cb_fn = fn;
- c->cb_arg = arg;
+ c->confirm = fn;
}
void
channel_register_cleanup(int id, channel_callback_fn *fn)
@@ -1882,9 +1878,9 @@ channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
if (compat20) {
c->remote_window = packet_get_int();
c->remote_maxpacket = packet_get_int();
- if (c->cb_fn != NULL && c->cb_event == type) {
+ if (c->confirm) {
debug2("callback start");
- c->cb_fn(c->self, c->cb_arg);
+ c->confirm(c->self, NULL);
debug2("callback done");
}
debug("channel %d: open confirm rwindow %d rmax %d", c->self,
diff --git a/usr.bin/ssh/channels.h b/usr.bin/ssh/channels.h
index fa43b8ea69d..781c49d479a 100644
--- a/usr.bin/ssh/channels.h
+++ b/usr.bin/ssh/channels.h
@@ -32,7 +32,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* RCSID("$OpenBSD: channels.h,v 1.61 2002/02/03 17:55:55 markus Exp $"); */
+/* RCSID("$OpenBSD: channels.h,v 1.62 2002/02/03 17:58:21 markus Exp $"); */
#ifndef CHANNEL_H
#define CHANNEL_H
@@ -101,9 +101,7 @@ struct Channel {
char *ctype; /* type */
/* callback */
- channel_callback_fn *cb_fn;
- void *cb_arg;
- int cb_event;
+ channel_callback_fn *confirm;
channel_callback_fn *detach_user;
/* filter */
@@ -149,8 +147,8 @@ void channel_stop_listening(void);
void channel_send_open(int);
void channel_request(int, char *, int);
void channel_request_start(int, char *, int);
-void channel_register_callback(int, int mtype, channel_callback_fn *, void *);
void channel_register_cleanup(int, channel_callback_fn *);
+void channel_register_confirm(int, channel_callback_fn *);
void channel_register_filter(int, channel_filter_fn *);
void channel_cancel_cleanup(int);
int channel_close_fd(int *);
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 2c858f911f3..5aec17c6d12 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.159 2002/01/27 18:08:17 stevesk Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.160 2002/02/03 17:58:21 markus Exp $");
#include <openssl/evp.h>
#include <openssl/err.h>
@@ -1141,9 +1141,7 @@ ssh_session2_open(void)
channel_send_open(c->self);
if (!no_shell_flag)
- channel_register_callback(c->self,
- SSH2_MSG_CHANNEL_OPEN_CONFIRMATION,
- ssh_session2_setup, (void *)0);
+ channel_register_confirm(c->self, ssh_session2_setup);
return c->self;
}