]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2002/02/03 17:58:21
authordjm <djm>
Tue, 5 Feb 2002 01:23:08 +0000 (01:23 +0000)
committerdjm <djm>
Tue, 5 Feb 2002 01:23:08 +0000 (01:23 +0000)
     [channels.c channels.h ssh.c]
     generic callbacks are not really used, remove and
     add a callback for msg of type SSH2_MSG_CHANNEL_OPEN_CONFIRMATION
     ok djm@

ChangeLog
channels.c
channels.h
ssh.c

index 1e31ab35e1a7f0e9627aaa8405c10d0d2d8f5b6e..41c277783364281d502c154c70b115b57276a153 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
    - markus@cvs.openbsd.org 2002/02/03 17:55:55
      [channels.c channels.h]
      remove unused channel_input_channel_request
+   - markus@cvs.openbsd.org 2002/02/03 17:58:21
+     [channels.c channels.h ssh.c]
+     generic callbacks are not really used, remove and
+     add a callback for msg of type SSH2_MSG_CHANNEL_OPEN_CONFIRMATION
+     ok djm@
 
 20020130
  - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
index 568779dffc2684a11561738d8a4922452ef34610..e5f910ed77b6dff4efade4781ec9ee27289e70ad 100644 (file)
@@ -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,
index fa43b8ea69dae22c40306f9b7621b14d5659e7a9..781c49d479ad9f3bdb012e4b6572cb3330d5bfaf 100644 (file)
@@ -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/ssh.c b/ssh.c
index 46d9d747a70dfc45ad3b8341edf4cbd57c458a5d..5ec27219e8f3763df11d8b631de81f027f96dbf3 100644 (file)
--- a/ssh.c
+++ b/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>
@@ -1161,9 +1161,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;
 }
This page took 1.103977 seconds and 5 git commands to generate.