diff --git a/sesman/chansrv/chansrv_common.c b/sesman/chansrv/chansrv_common.c index c1e064c8..a6417ad5 100644 --- a/sesman/chansrv/chansrv_common.c +++ b/sesman/chansrv/chansrv_common.c @@ -46,6 +46,7 @@ read_entire_packet(struct stream *src, struct stream **dest, int chan_flags, /* packet not fragmented */ xstream_new(ls, total_length); xstream_copyin(ls, src->p, length); + s_mark_end(ls); ls->p = ls->data; *dest = ls; return 1; @@ -67,7 +68,8 @@ read_entire_packet(struct stream *src, struct stream **dest, int chan_flags, /* in last packet, chan_flags & 0x02 will be true */ if (chan_flags & 0x02) { - /* rewind stream */ + /* terminate and rewind stream */ + s_mark_end(ls); ls->p = ls->data; return 1; } diff --git a/sesman/chansrv/devredir.c b/sesman/chansrv/devredir.c index 1dbf3975..d5f7313a 100644 --- a/sesman/chansrv/devredir.c +++ b/sesman/chansrv/devredir.c @@ -317,6 +317,7 @@ devredir_data_in(struct stream *s, int chan_id, int chan_flags, int length, return 0; } + s_mark_end(g_input_stream); g_input_stream->p = g_input_stream->data; ls = g_input_stream; }