diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c index ea1e7f25..85d5312e 100644 --- a/libxrdp/libxrdp.c +++ b/libxrdp/libxrdp.c @@ -206,7 +206,17 @@ libxrdp_process_data(struct xrdp_session *session, struct stream *s) if (do_read) { - s = libxrdp_force_read(session->trans); + if (s == 0) + { + s = libxrdp_force_read(session->trans); + } + else + { + if ((s->next_packet == 0) || (s->next_packet >= s->end)) + { + s = libxrdp_force_read(session->trans); + } + } if (s == 0) { g_writeln("libxrdp_process_data: libxrdp_force_read failed"); @@ -281,8 +291,7 @@ libxrdp_process_data(struct xrdp_session *session, struct stream *s) if (cont) { - cont = (s->next_packet != 0) && - (s->next_packet < s->end); + cont = (s->next_packet != 0) && (s->next_packet < s->end); } } diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index 729a2f29..ccc4f8b5 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -304,13 +304,14 @@ xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code) if (s->next_packet == 0 || s->next_packet >= s->end) { /* check for fastpath first */ - header = (const tui8 *) (self->session->trans->in_s->p); + header = (const tui8 *) (s->p); if ((header[0] != 0x3) && (header[0] != 0x3c)) { if (xrdp_sec_recv_fastpath(self->sec_layer, s) != 0) { return 1; } + s->next_packet = 0; *code = 2; // special code for fastpath input DEBUG(("out (fastpath) xrdp_rdp_recv")); return 0; @@ -387,6 +388,7 @@ xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code) return 0; } } + /*****************************************************************************/ int APP_CC xrdp_rdp_send(struct xrdp_rdp *self, struct stream *s, int pdu_type)