Movied ansi parser out of channel code and put it in a filter
This commit is contained in:
parent
1c9731059d
commit
41f53d605c
|
@ -2479,7 +2479,7 @@ channel_input_data(int type, u_int32_t seq, void *ctxt)
|
|||
if (c->datagram)
|
||||
buffer_put_string(&c->output, data, data_len);
|
||||
else {
|
||||
#ifndef WIN32_FIXME
|
||||
#if(1)//ndef WIN32_FIXME
|
||||
buffer_append(&c->output, data, data_len);
|
||||
#else
|
||||
if ( c->client_tty )
|
||||
|
|
22
clientloop.c
22
clientloop.c
|
@ -1520,6 +1520,24 @@ client_simple_escape_filter(Channel *c, char *buf, int len)
|
|||
buf, len);
|
||||
}
|
||||
|
||||
#ifdef WIN32_FIXME
|
||||
u_char * client_ansi_parser_filter(Channel *c, u_char **buf, u_int *len) {
|
||||
if (c->isatty) {
|
||||
telProcessNetwork(buffer_ptr(&c->output), buffer_len(&c->output));
|
||||
buffer_clear(&c->output);
|
||||
buffer_append(&c->output, " \b", 2);
|
||||
*buf = buffer_ptr(&c->output);
|
||||
*len = buffer_len(&c->output);
|
||||
return *buf;
|
||||
}
|
||||
else {
|
||||
*buf = buffer_ptr(&c->output);
|
||||
*len = buffer_len(&c->output);
|
||||
return *buf;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
client_channel_closed(int id, void *arg)
|
||||
{
|
||||
|
@ -1606,7 +1624,11 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
|
|||
if (session_ident != -1) {
|
||||
if (escape_char_arg != SSH_ESCAPECHAR_NONE) {
|
||||
channel_register_filter(session_ident,
|
||||
#ifdef WIN32_FIXME
|
||||
client_simple_escape_filter, client_ansi_parser_filter,
|
||||
#else
|
||||
client_simple_escape_filter, NULL,
|
||||
#endif
|
||||
client_filter_cleanup,
|
||||
client_new_escape_filter_ctx(
|
||||
escape_char_arg));
|
||||
|
|
|
@ -60,6 +60,9 @@ size_t telProcessNetwork ( char *buf, size_t len )
|
|||
size_t Result;
|
||||
unsigned char* pszNewHead;
|
||||
|
||||
if ((len == 1) && (buf[0] == 13))
|
||||
buf[0] = 10;
|
||||
|
||||
if (1)
|
||||
{
|
||||
Result = len ;
|
||||
|
|
Loading…
Reference in New Issue