diff options
Diffstat (limited to 'xrdp/xrdp_process.c')
-rw-r--r-- | xrdp/xrdp_process.c | 62 |
1 files changed, 4 insertions, 58 deletions
diff --git a/xrdp/xrdp_process.c b/xrdp/xrdp_process.c index ab4808b0..c60c40dc 100644 --- a/xrdp/xrdp_process.c +++ b/xrdp/xrdp_process.c @@ -115,63 +115,6 @@ xrdp_process_mod_end(struct xrdp_process *self) } /*****************************************************************************/ -static int APP_CC -xrdp_process_get_pdu_bytes(const char *aheader) -{ - int rv; - const tui8 *header; - - rv = -1; - header = (const tui8 *) aheader; - - if (header[0] == 0x03) - { - /* TPKT */ - rv = (header[2] << 8) | header[3]; - } - else if (header[0] == 0x30) - { - /* TSRequest (NLA) */ - if (header[1] & 0x80) - { - if ((header[1] & ~(0x80)) == 1) - { - rv = header[2]; - rv += 3; - } - else if ((header[1] & ~(0x80)) == 2) - { - rv = (header[2] << 8) | header[3]; - rv += 4; - } - else - { - g_writeln("xrdp_process_get_packet_bytes: error TSRequest!"); - return -1; - } - } - else - { - rv = header[1]; - rv += 2; - } - } - else - { - /* Fast-Path */ - if (header[1] & 0x80) - { - rv = ((header[1] & 0x7F) << 8) | header[2]; - } - else - { - rv = header[1]; - } - } - return rv; -} - -/*****************************************************************************/ static int DEFAULT_CC xrdp_process_data_in(struct trans *self) { @@ -197,12 +140,13 @@ xrdp_process_data_in(struct trans *self) { pro->server_trans->extra_flags = 1; pro->server_trans->header_size = 4; + init_stream(s, 0); } break; case 1: /* we have enough now to get the PDU bytes */ - len = xrdp_process_get_pdu_bytes(s->p); + len = libxrdp_get_pdu_bytes(s->p); if (len == -1) { g_writeln("xrdp_process_data_in: " @@ -259,6 +203,8 @@ xrdp_process_main_loop(struct xrdp_process *self) if (libxrdp_process_incomming(self->session) == 0) { + init_stream(self->server_trans->in_s, 32 * 1024); + term_obj = g_get_term_event(); cont = 1; |