[channels.c channels.h ssh.c]
     merge channel_request() into channel_request_start()
This commit is contained in:
Damien Miller 2002-02-08 22:04:26 +11:00
parent 8829d3669d
commit a500cd608e
4 changed files with 13 additions and 16 deletions

View File

@ -10,6 +10,9 @@
- djm@cvs.openbsd.org 2002/02/05 00:00:46 - djm@cvs.openbsd.org 2002/02/05 00:00:46
[sftp.1 sftp.c sftp-client.c sftp-client.h sftp-int.c] [sftp.1 sftp.c sftp-client.c sftp-client.h sftp-int.c]
Add "-B" option to specify copy buffer length (default 32k); ok markus@ Add "-B" option to specify copy buffer length (default 32k); ok markus@
- markus@cvs.openbsd.org 2002/02/05 14:32:55
[channels.c channels.h ssh.c]
merge channel_request() into channel_request_start()
20020205 20020205
- (djm) Cleanup after sync: - (djm) Cleanup after sync:
@ -7516,4 +7519,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.1830 2002/02/08 11:04:05 djm Exp $ $Id: ChangeLog,v 1.1831 2002/02/08 11:04:26 djm Exp $

View File

@ -39,7 +39,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: channels.c,v 1.165 2002/02/03 17:58:21 markus Exp $"); RCSID("$OpenBSD: channels.c,v 1.166 2002/02/05 14:32:55 markus Exp $");
#include "ssh.h" #include "ssh.h"
#include "ssh1.h" #include "ssh1.h"
@ -588,20 +588,14 @@ channel_send_open(int id)
} }
void void
channel_request(int id, char *service, int wantconfirm) channel_request_start(int local_id, char *service, int wantconfirm)
{ {
channel_request_start(id, service, wantconfirm); Channel *c = channel_lookup(local_id);
packet_send();
debug("channel request %d: %s", id, service) ;
}
void
channel_request_start(int id, char *service, int wantconfirm)
{
Channel *c = channel_lookup(id);
if (c == NULL) { if (c == NULL) {
log("channel_request: %d: bad id", id); log("channel_request_start: %d: unknown channel id", local_id);
return; return;
} }
debug("channel request %d: %s", local_id, service) ;
packet_start(SSH2_MSG_CHANNEL_REQUEST); packet_start(SSH2_MSG_CHANNEL_REQUEST);
packet_put_int(c->remote_id); packet_put_int(c->remote_id);
packet_put_cstring(service); packet_put_cstring(service);

View File

@ -32,7 +32,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/* RCSID("$OpenBSD: channels.h,v 1.62 2002/02/03 17:58:21 markus Exp $"); */ /* RCSID("$OpenBSD: channels.h,v 1.63 2002/02/05 14:32:55 markus Exp $"); */
#ifndef CHANNEL_H #ifndef CHANNEL_H
#define CHANNEL_H #define CHANNEL_H
@ -145,7 +145,6 @@ void channel_free_all(void);
void channel_stop_listening(void); void channel_stop_listening(void);
void channel_send_open(int); void channel_send_open(int);
void channel_request(int, char *, int);
void channel_request_start(int, char *, int); void channel_request_start(int, char *, int);
void channel_register_cleanup(int, channel_callback_fn *); void channel_register_cleanup(int, channel_callback_fn *);
void channel_register_confirm(int, channel_callback_fn *); void channel_register_confirm(int, channel_callback_fn *);

5
ssh.c
View File

@ -39,7 +39,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: ssh.c,v 1.160 2002/02/03 17:58:21 markus Exp $"); RCSID("$OpenBSD: ssh.c,v 1.161 2002/02/05 14:32:55 markus Exp $");
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/err.h> #include <openssl/err.h>
@ -1110,7 +1110,8 @@ ssh_session2_setup(int id, void *arg)
packet_put_string(buffer_ptr(&command), buffer_len(&command)); packet_put_string(buffer_ptr(&command), buffer_len(&command));
packet_send(); packet_send();
} else { } else {
channel_request(id, "shell", 0); channel_request_start(id, "shell", 0);
packet_send();
} }
/* channel_callback(id, SSH2_MSG_OPEN_CONFIGMATION, client_init, 0); */ /* channel_callback(id, SSH2_MSG_OPEN_CONFIGMATION, client_init, 0); */