Commit 7e53eac2 authored by Niels Möller's avatar Niels Möller
Browse files

* src/channel.h (class ssh_channel): Changed receive method to

take a length and pointer, rather than an lsh_string. Updated
method implementations.

Rev: src/channel.h:1.77.2.8
Rev: src/client_session.c:1.21.2.4
Rev: src/server_session.c:1.103.2.7
parent ed0ddb4a
......@@ -114,7 +114,8 @@ enum channel_flag {
(sinks . unsigned)
; Type is CHANNEL_DATA or CHANNEL_STDERR_DATA
(receive method void "int type" "struct lsh_string *data")
(receive method void "int type"
"uint32_t length" "const uint8_t *data")
; Called when we are allowed to send more data on the channel.
; Implies that the send_window_size is non-zero.
......@@ -136,8 +137,8 @@ enum channel_flag {
*/
#define CHANNEL_RECEIVE(s, t, d) \
((s)->receive((s), (t), (d)))
#define CHANNEL_RECEIVE(s, t, l, d) \
((s)->receive((s), (t), (l), (d)))
#define CHANNEL_SEND_ADJUST(s, i) ((s)->send_adjust((s), (i)))
......
......@@ -130,8 +130,8 @@ oop_write_stderr(oop_source *source UNUSED,
/* FIXME: Use length, pointer instead of a string */
/* Receive channel data */
static void
do_receive(struct ssh_channel *s,
int type, struct lsh_string *data)
do_receive(struct ssh_channel *s, int type,
uint32_t length, const uint8_t *data)
{
CAST(client_session, session, s);
......@@ -140,17 +140,16 @@ do_receive(struct ssh_channel *s,
case CHANNEL_DATA:
channel_io_write(&session->super, &session->out,
oop_write_stdout,
STRING_LD(data));
length, data);
break;
case CHANNEL_STDERR_DATA:
channel_io_write(&session->super, &session->err,
oop_write_stderr,
STRING_LD(data));
length, data);
break;
default:
fatal("Internal error!\n");
}
lsh_string_free(data);
}
/* Reading stdin */
......
......@@ -136,8 +136,8 @@ oop_write_stdin(oop_source *source UNUSED,
}
static void
do_receive(struct ssh_channel *s,
int type, struct lsh_string *data)
do_receive(struct ssh_channel *s, int type,
uint32_t length, const uint8_t *data)
{
CAST(server_session, session, s);
......@@ -146,7 +146,7 @@ do_receive(struct ssh_channel *s,
case CHANNEL_DATA:
channel_io_write(&session->super, &session->in,
oop_write_stdin,
STRING_LD(data));
length, data);
break;
case CHANNEL_STDERR_DATA:
......@@ -155,7 +155,6 @@ do_receive(struct ssh_channel *s,
default:
fatal("Internal error!\n");
}
lsh_string_free(data);
}
static void *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment